Closing stdin of asynchronous sub processes
"Eric Mangold" <[email protected]> Wed, 6 Apr 2005 20:07:57 +1000 (ChST)
| Newsgroups | gmane.lisp.librep |
|---|---|
| Message-ID | <[email protected]> |
Hello, I need set the primary X selection from rep (under sawfish) and it seems like using the xclip(1) program is the easiest way. To test outside of sawfish, I run this with rep: (setq proc (make-process)) (start-process proc "xclip" "-i") ;;this reads the text to set from stdin (write proc "set selection to this") OK, that works fine if you just run it with no event-loop. But, if you ad= d the event loop... (setq interrupt-mode 'exit) ;; make it so we can C-c out (setq proc (make-process)) (start-process proc "xclip" "-i") ;;this reads the text to set from stdin (write proc "set selection to this") (recursive-edit) Then the xclip program is indeed launched but it never terminates because it's stdin is still waiting for EOF. Apparently in the non-event-loop version, the terminating of the rep binary forces the stdin/out/err of xclip to be closed, and so xclip goes and does its thing. So how does one close the stdin (if that is indeed my problem)? Thanks, Eric Mangold ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick