Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now here is the seemingly impossible parts: say there are two files in main and the last time the program ran, it had moved a file to /dir2, it now needs to put one file in /dir3 and the other in /dir4. (date/time stamp of files is no issue as this will be a cron job or it will sleep and run every 5 minutes) Say this program runs again and there is a file in /main, it now needs to start at /dir5. And as if this isn't bad enough, if there is no file there, it needs to remember the last /dir# it was at and pick up from there! aaargh! I'm thinking the program can read a file with all the /dir#'s into an array, shift them somehow and white back out to the file. Do a substr to take out the valid /dir# then FORMAT a executable sh file with 'mv /main @<<<<<<' type thing. Assuming this is not impossible, Thanks for any code help I can get!a file shows up in /main, it needs to move to /dir1 another file shows up in /main, it moves to /dir2 ditto for /dir3 through /dir6 then we need to start again at /dir1 a round-robbin approach to file distribution.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sequential file handling (yet again)
by dws (Chancellor) on Jun 03, 2002 at 19:26 UTC | |
|
Re: sequential file handling (yet again)
by particle (Vicar) on Jun 03, 2002 at 19:35 UTC | |
|
Re: sequential file handling (yet again)
by Abigail-II (Bishop) on Jun 04, 2002 at 09:47 UTC | |
|
Re: sequential file handling (yet again)
by Zaxo (Archbishop) on Jun 03, 2002 at 19:50 UTC | |
|
Re: sequential file handling (yet again)
by insensate (Hermit) on Jun 03, 2002 at 19:45 UTC |