ranciid has asked for the wisdom of the Perl Monks concerning the following question:
There's a directory (in Windows) that I have to monitor for new files created (sftp) there. Once it is created/dropped, I have to move (by sftp) it to another server for processing.
There is no fixed schedule when these files are created and there's no fixed file size either. The files can come immediately one after another in a "stream" or file by file over a period of time.
I have looked through perl modules "Win32::ChangeNotify", "File::Monitor::Simple" and "Dir-Watch" but I don't seem to be able to find where / how to find the filename of the newly created file.
Some concerns :
1) How do I avoid "race conditions"? If a big file happened to be created, how do I ensure that it is completely created before it is sftp-ed to the other processing server?
2) if the files come one after another, how should they be queued for processing?
Apologies for the lengthy maiden post as I am a complete newbie and I hope someone out there can help.
Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Monitoring directory for new files
by ikegami (Patriarch) on Jan 20, 2010 at 05:29 UTC | |
|
Re: Monitoring directory for new files
by Marshall (Canon) on Jan 20, 2010 at 05:57 UTC | |
by ikegami (Patriarch) on Jan 20, 2010 at 06:01 UTC | |
by Marshall (Canon) on Jan 20, 2010 at 06:12 UTC | |
by ikegami (Patriarch) on Jan 20, 2010 at 15:53 UTC | |
|
Re: Monitoring directory for new files
by cdarke (Prior) on Jan 20, 2010 at 06:31 UTC | |
by tokpela (Chaplain) on Jan 21, 2010 at 11:22 UTC | |
|
Re: Monitoring directory for new files
by salva (Canon) on Jan 20, 2010 at 09:32 UTC | |
|
Re: Monitoring directory for new files
by pdltiger (Acolyte) on Jan 20, 2010 at 14:04 UTC | |
|
Re: Monitoring directory for new files
by ranciid (Novice) on Jan 25, 2010 at 03:12 UTC |