PHP first Delete and re-create a file when the creation date of the file is not updated
The code is as follows:
PHP Code
Var_dump (Unlink ("Update1.log")); True$handle=fopen ("Update1.log", "w"); Create File Fwrite ($handle, Date ("y-m-d h:i:s")); fclose ($handle);
The expected result is that the creation time of Update1.log can be changed to fopen () time when the file was created.
The actual result is that the creation time of the Update1.log has been the first time it was created, as if there were no unlink ().
We can't think of the solution ~
I beg you prawns who can help to dispel the question ~
PS: My operating system is Win7
------Solution--------------------
Some of the upstairs guys take it for granted
It is true that the landlord observes the same thing, at least in the window system.
But this has nothing to do with PHP, it's the file system.
It is estimated that the directory entry was not cleared when the file was deleted (only the delete flag) and the original catalog item was used when it was created again
You can think of "File creation time" as the time when the catalog item was created
PHP has the function to get that time filectime
------Solution--------------------
Explore
There's a point upstairs, who knows what's going on under Linux?