I suggest to use is_writable($dir.$name)
after the file has been touched / created (files get saved AFTER fclose
). touch()
is also a good approach for initially creating a file and test wether it can be written.
Could try:
touch($dir.$name);
is_writable($dir.$name);
//parse the output of
shell_exec('touch ' . $dir . $name);
// or
exec('touch ' . $dir . $name);
Would also be interesting what this prints:
filetype($dir.$name);
From http://www.php.net/manual/en/function.filetype.php
There are 7 values that can be returned. Here is a list of them and what each one means block: block special device char: character special device dir: directory fifo: FIFO (named pipe) file: regular file link: symbolic link unknown: unknown file type
// also interesting:
stat($dir.$name);