Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Detect whether a writeable filehandle has closed?

by jdporter (Paladin)
on Jan 14, 2021 at 14:48 UTC ( [id://11126912]=note: print w/replies, xml ) Need Help??


in reply to Re: Detect whether a writeable filehandle has closed?
in thread Detect whether a writeable filehandle has closed?

Thank you for that. I think I'd be ok if I got the SIGPIPE instantaneously, but as I said it appears that the signal has to "make its way through the system" before my handler code gets control, by which time I may have written any number of additional lines to the child. :-(

Replies are listed 'Best First'.
Re^3: Detect whether a writeable filehandle has closed?
by shmem (Chancellor) on Jan 14, 2021 at 14:56 UTC

    As said, you get the SIPGPIPE immediately after the first unsuccessful write, so you may want to keep your amount of lines short for each write.

    If you have control of the child you could make it send a HUP or USR1 to its parent after closing the file handle.

    Update: Oh I see you haven't, a compiled C program... hm. A wrapper, maybe?

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 02:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found