[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

detecting broken pipe

From: Dan McMahill
Subject: detecting broken pipe
Date: Mon, 24 Apr 2006 00:23:20 -0400
User-agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7.6) Gecko/20050412


I'm doing something like the following:

(use-modules (ice-9 popen))

(define pcb:pipe #f)

(define (pcb:launch-pcb)
  (set! pcb:pipe (open-output-pipe "pcb --listen"))

then later on I call pcb:launch-pcb and send stuff with

(display "some string" pcb:pipe)

This is all good right up until the "pcb --listen" command finishes (perhaps becuase it is a gui program and someone simply exited from it). At this point the pipe is broken and the program which uses guile crashes.

So is there an easy way to detect when the pipe was terminated so I can avoid crashing?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]