Re: Check if directory has changed

From: Date: Sun, 26 Jan 2003 02:42:11 +0000
Subject: Re: Check if directory has changed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133151@lists.php.net to get a copy of this message
Hi Carlos, Directories are just normal files thus they have "Last Modified" and "Last Changed" time stamps. So the quickest and easiest way is to check these times periodically and if any of them has changed then there was some activity other than reading in the directory. You can get the timestamps using stat() function. Regards, Peter "Carlos Fernando Scheidecker Antunes" <nando@antunes.eti.br> wrote in message news:003301c2c4df$d3fa42e0$9d505ad1@Nando0... I would like to write a function to check if the contents of a directory, its files, have been changed. The idea is to check the directory every 2 minutes and take some actions if some files were updated or new files added. Does anyone has any ideas? I was considering listing the files (name, date modified, size) on a variable array, then list again and compare both arrays. In case there are different, take some action. Thank you, C.F.

« previous php.general (#133151) next »