PDA

View Full Version : [SOLVED] PHP: Determine if directory contents changed



x1a4
January 10th, 2008, 07:38 PM
Hi,

Using PHP4.4.6, Is it possible, and if so how, to determine if the contents of a directory have changed?

Thank you.

LaRoza
January 10th, 2008, 07:56 PM
You could use http://www.php.net/manual/en/function.scandir.php or other such functions and put the contents in a file, then write a function to test the contents against that file.

popch
January 10th, 2008, 08:25 PM
The file system usually keeps a time stamp for each directory entry which registers the date and time the object was last changed. This applies both to files and directories. In some circumstances just checking the time stamp of the directory might suffice. Can you read the date and time the entry was last changed in PHP?