I'm creating directories and files inside of a php program and they are
owned by nobody.
How can I assign an owner to them and who should the owner be?
Where is documentation for these types of questions?
Here is the code snipet:
create a directory - I would also like to create it with 775 privledges, but
I can't create a file in the directory unless it is 777:
if(!file_exists(DIRECTORY))
{
// create the directory
$oldumask = umask(0);
mkdir(DIRECTORY, 0777); // or even 775 is more secure
umask($oldumask);
if(!is_dir(DIRECTORY))
{
$return_status[0] = false;
$return_status[1] = "there was an error creating the
directory.";
return $return_status;
}
}
create a file:
$fd = fopen($file,"w+");
if(!$fd)
{
$return_status[0] = false;
$return_status[1] = "3) A system configuration error has been
detected.
Your request cannot be processed.";
return $return_status;
}
Thanks in advance for your help,
Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]