This is a discussion on php mkdir touch time-date problem within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Dear all, I have a problem which I can not explain-understand. I hope someone can help me. I use ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dear all,
I have a problem which I can not explain-understand. I hope someone can help me. I use php under WinXP. I want to copy a dir to another location, afterwards I want to set the date and time stamp identical as the original dir. But for some reason, I get the following error message : Warning: touch(): Utime failed: Permission denied in C:\PHP\run.php on line 138 $key_search = new dir name $key = org dir name if (mkdir($key_search,0777)) { echo "Succesfully made dir : $key_search<BR>"; // chmod($key_search, 0777); // I tried with this line as well! but I doesn't work touch ($key_search,filemtime($key));// set back original date and time } else { echo "Error : Failed to make dir : $key_search<BR>"; } My dir is made, but with the time stamp of creation!! Many thanks in advance. Michris |
|
|||
|
Dear Michris,
I tried to do this in PHP too : Make a copy of a directory while keeping the date stamp of that directory. And it does not work, I cannot find a way to change the date of a directory (in PHP under windows). Isn't there really anybody who has ever done this in PHP (under windows) ??? Regards DudeMan Nr 2 "michris" <michris_nospam@oostendenaar.be> wrote in news:EcIAb.778$Lf5.150561162@hestia.telenet-ops.be: > Dear all, > > I have a problem which I can not explain-understand. > I hope someone can help me. > I use php under WinXP. > > I want to copy a dir to another location, afterwards I want to set the > date and time stamp identical as the original dir. But for some reason, > I get the following error message : > Warning: touch(): Utime failed: Permission denied in C:\PHP\run.php on > line 138 > > $key_search = new dir name > $key = org dir name > > if (mkdir($key_search,0777)) > { > echo "Succesfully made dir : $key_search<BR>"; > > // chmod($key_search, 0777); // I tried with this line as well! but > I doesn't work > touch ($key_search,filemtime($key));// set back original date and > time > } > else > { > echo "Error : Failed to make dir : $key_search<BR>"; > } > > > My dir is made, but with the time stamp of creation!! > > > Many thanks in advance. > Michris > > > > |