Keep It Simple, Stupid | |
PerlMonks |
Re: running Perl scripts in the backgroundby BrowserUk (Patriarch) |
on Jul 12, 2007 at 07:51 UTC ( [id://626163]=note: print w/replies, xml ) | Need Help?? |
If you put the list of files in a file, and read that file backwards, and truncate it after you've finished processing each file you read from it, then when you re-start the script, it will pick up the same file you were processing when you crashed. If you truncate the file just after reading a filename, remember the position of the new EOF, then you could write your current position in the data file at that position in the list file after each read of the data file. A small tweak to check for a position when you read the list file and a you can seek to that position when you re-open it after a re-start. Something like (untested):
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|