Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: bullet proof SLURP file

by Marshall (Canon)
on Jan 10, 2018 at 00:06 UTC ( [id://1207024]=note: print w/replies, xml ) Need Help??


in reply to Re^2: bullet proof SLURP file
in thread bullet proof SLURP file

This is a program that computes data for manufacturing in company. I have to be sure that when data read from local file is broken in the middle of the process of reading, then the whole program fails.
I have worked with many HD's that have either hardware errors or file system errors (usually both types of errors occur at the same time). Your original Perl program will abend with a fatal error if the complete HD file cannot be read. It is possible to open a file which cannot be successfully read to the EOF.

close() does a lot for a "writer" -> flushes unwritten cached stuff to the HD. Not so much is done for a reader. A close() on a read handle does not modify the actual file that is being read. Again, that is not true on a write handle.

Your original program will fail if the file is corrupted. Let's say that happens, then what is your "Plan"? A redundant disk system is probably what is needed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1207024]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-23 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found