I tested both the filectime () and filemtime () functions on a Linux server, and they work correctly in directories, in the sense that they return a timestamp.
Then I tried to get the last modified date of the directory, renaming it via FTP, and then checking it again, and here's the weird thing that happened:
- creation date timestamp was updated with current time
- the last modified date was not updated at all
I think this could be due to the manipulation of FTP files instead of direct processing through the command line or system GUI.
On Windows, both the creation date and the date of the last change do not change when renaming a directory.
For your tests, I also suggest you take a look at the clearstatcache () function (which I also used in my test) to clear the PHP cache of file system information.
source share