PDA

View Full Version : Create a file with permissions set


Dalziel
05-02-2003, 01:56 PM
I use

if(!file_exists("file.txt"))
{
$fp = fopen("file.txt", "w");
fwrite($fp, "0");
fclose($fp);
}

Is there any way I could do that and CHMOD the file I created?

Ökii
05-02-2003, 03:25 PM
chmod(touch($file),0644);

x_goose_x
05-02-2003, 04:17 PM
http://www.php.net/manual/en/function.chmod.php

Dalziel
05-06-2003, 03:34 PM
Can you chmod a directory with it?