Re: [Haskell-cafe] Preventing leaked open file descriptors whencatching exceptions

2012-02-22 Thread Albert Y. C. Lai
I cannot reproduce pretty much any claim made in this thread. Unless PIO does not mean System.IO.Posix. I run "mkfifo hello" to create a named pipe. Then I run this program to keep trying to open for writing, non-blocking (without anyone at the read end initially): import System.Posix.IO imp

Re: [Haskell-cafe] Preventing leaked open file descriptors whencatching exceptions

2012-02-21 Thread Ryan Newton
Ah, thanks Bryan. I hadn't looked into it enough to realize that FDs are just ints and not ForeignPtrs w/ finalizers. Re: Donn's point. Well, yes, that would seem to be the case! But since I think a linux bug is unlikely, I'm afraid that there's something else going on here which I am not think

Re: [Haskell-cafe] Preventing leaked open file descriptors whencatching exceptions

2012-02-21 Thread Donn Cave
Quoth "Bryan O'Sullivan" , > On Tue, Feb 21, 2012 at 8:16 AM, Ryan Newton wrote: > >> FYI, lsof confirms that there are indeed many many open connections to the >> same FIFO: >> > > Like all of the lowest-level I/O functions, openFD just gives you back an > integer, and the Fd type has no notion t