Help Required for creating Directories & Files on Linux
Pls look at my situation , I am creating a email application
I want to store all my attachments & uploads to Different directory
eg :
my $DOCUMENT_ROOT gives output as /www/vhtdocs/hemensite
nowunder hemensite I have 2 directories namely mainsite & data
All my scripts r under mainsite
& under data there r 2 more directories uploads & attachments
so I think the structure would be like
/www/vhtdocs/hemensite/mainsite
/www/vhtdocs/hemensite/data/uploads
/www/vhtdocs/hemensite/data/attachments
Now if I run a php script ( create.php ) under mainsite
ie. my $SCRIPT_FILENAME
would look like
/www/vhtdocs/hemensite/mainsite/create.php
I want to create a runtime
temporary directory eg . temp2000 under attachments
ie the structure would be like
/www/vhtdocs/hemensite/data/attachments/temp2000.
Also Now if I run a php script ( store.php ) under mainsite
ie. my $SCRIPT_FILENAME
would look like ( /www/vhtdocs/hemensite/mainsite/store.php )
I want to copy a file (hemen.jpg ) to temp2000 directory
ie the structure would be like
/www/vhtdocs/hemensite/data/attachments/temp2000/hemen.jpg.
Can u tell me what code should I write in create.php file to
create a directory seeing the above situation.
I used this code
$dirname=$DOCUMENT_ROOT ."/data/uploads/temp2000";
mkdir($dirname,0777);
But this gives an error.
MkDir failed (No such file or directory) in /www/vhtdocs/hemensite/data/create.php on line 19
This code creates the directory when run on Apache on Windows
but gives error when run on Linux.
If u have a soln for this pls mail me at
hemenkhatri@usa.net
Please help me out. Its very URGENT.