in reply to File::Copy - move() function corrupting files
There are several things you could do: when you detect a new PDF, just sleep for some time before starting to process it (that works only is the time for the file to arrive is relatively constant). Another way is to have the process delivering the files to copy the files with a different name (e.g. an extension other that ".pdf", such as ".tmp"), and to rename the file only when the file delivery is complete. Or the process delivering the files could put a flag (an empty file with a name similar to the file being delivered) in the directory and remove the flag once delivery is complete. This way, your program knows when it can start processing the file safely
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File::Copy - move() function corrupting files
by myelinviolin (Novice) on Aug 25, 2014 at 16:19 UTC | |
by Laurent_R (Canon) on Aug 25, 2014 at 17:29 UTC |