RE: [PHP] php fam problems
| From: | Jay Blanchard | Date: | Fri, 06 Aug 2004 12:40:51 +0000 |
| Subject: | RE: [PHP] php fam problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192983@lists.php.net to get a copy of this message | ||
[snip]
I'm trying to use the fam module from cli-php5 with the example code
from
http://de2.php.net/manual/en/ref.fam.php. It
works, but when I copy a
big file into an observed folder, I get a FAMCreated for the file, and
then, while the copying is still in progress, multiple FAMChanged.
I want to watch a folder and process the files that are either new or
changed. Currently, I would end up processing a new or changed file n
times,
with n depending on the file's size. I'd like to get ONE FAMCreated for
a
new file AFTER it was completely created and ONE FAMChanged for a file
AFTER a process is done changing it. Is that possible?
[/snip]
Because the stat of the file changes you will get multiple FAMChanged.
You may have to test for a time since last FAMChanged and wait a
suitable amount of time to take any actions on the file.
[snip]
Also, when I watch i.e. /mnt, FAM doesn't notify me of events in /mnt's
subdirectories, the monitoring seems to be non-recursive. Can I change
this, or will I have to fam_monitor_directory each directory separately?
[/snip]
fam_monitor_directory is non-recursive.