Re: [PHP] Import files from directory

2009-01-06 Thread clive

Merlin Morgenstern wrote:


Has anybody an idea on how to do this? Thank you for any hint.


I searched for this in google "linux watch for new files"

and found this: http://www.linux.com/feature/150200

Clive




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Import files from directory

2009-01-05 Thread Daevid Vincent
On Tue, 2009-01-06 at 01:01 +0100, Merlin Morgenstern wrote:

> Hi everybody,
> 
> I am running a real estate portal and would like to allow users to 
> upload their listing from their existing software. They do this with a 
> XML file which they will upload on a ftp server that places this xml 
> file into a seperate directory on the file system.
> 
> My basic idea was to run a php scipt triggered by cron every 5 minutes 
> that checks if there is a new upload and then reads the file and removes 
> it. Now here is where the problem starts. Imagine if there are 1000 
> users, I would need to go through 1000 folders to check for new content. 
>   There must be a better solution to identify the directory that has a 
> new  finished upload.
> 
> Has anybody an idea on how to do this? Thank you for any hint.
> 
> Best regards,
> 
> Merlin


You might do well to ask the Oracle known as Google. 
This be what I hit first try with "unix directory change notification":
http://aplawrence.com/Unixart/watchdir.html

The top of the dir tree will tell thee dates and times that contents
changed below/within it, so one could just scan the root 'customer' dirs
first to see which one has been modified, then traverse it and work
thine magic. Order them with this incantation "ls -lct" and pop off the
top ones for 'todays date' or 'hour' or something might also get you
more closer to what you want. rinse. repeat.

I'm out of wizard puns. ;-)