Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: capturing syswrite failures

by bluto (Curate)
on Mar 01, 2007 at 19:48 UTC ( #602765=note: print w/ replies, xml ) Need Help??


in reply to Re: capturing syswrite failures
in thread capturing syswrite failures

print makes sense if you turn off buffering -- which is pretty close to the same as using syswrite. If buffering is involved, print makes it very hard to recover and continue after an error since the error can be deferred. You also need to remember to do an explicit close and check the error on that.

For example, if NFS returns ESTALE (e.g. after a server reboot), you may have to close and reopen the file before the NFS server will allow you to write. That close is going to try, and fail, to send the buffered data. Figuring out what data to resend in this case is easy with syswrite (e.g. close, open, syswrite the buffer again).


Comment on Re^2: capturing syswrite failures

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-12-22 04:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls