[prev in list] [next in list] [prev in thread] [next in thread]
List: php-general
Subject: Re: [PHP] php fam problems
From: Benjamin Adler <benadler () gmx ! net>
Date: 2004-08-06 22:18:46
Message-ID: 200408070018.46226.benadler () gmx ! net
[Download RAW message or body]
Jay, thank you for your answer!
The fact that fam_monitor_directory is non-recursive gives me trouble since I
need to monitor a whole tree of directories and files.
I could easily traverse all subdirectories and add them to the fam resource
with fam_monitor_directory. But unfortunately, the 'file' in the array I get
from fam_next_event() contains only the file-basename, not the full path of
the file. So I'll never know where in my directory-tree the current file is.
And since there might be multiple files with the same basename in different
monitored directories, I'm stuck.
How can I monitor multiple directories and get to know exactly which file
changed? Will I have to create as many fam-resources as I have directories?
thank you!
ben adler
Am Freitag, 6. August 2004 14:40 schrieb Jay Blanchard:
> [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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic