Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: capturing syswrite failures

by bluto (Curate)
on Mar 01, 2007 at 19:48 UTC ( [id://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).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found