Do you have control of the process that writes to the file? If so, assure that it implements file locking, and cause it to also create a checksum that is saved in another file alongside the primary file. After writing, verify the checksum matches what got written.
Then the reader can obtain a lock, read the checksum, read the target file, compare, and derive a strong assurance that the entire file was read.
Otherwise, check file size before the read and after the read. Check the mtime before the read and after. If it changed, that's bad. Use the bytes pragma and get the length of the scalar holding the input. Compare that length to the file size detected before the read. And check for eof after the read.
Dave
In reply to Re: bullet proof SLURP file
by davido
in thread bullet proof SLURP file
by leszekdubiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |