> Would it be possible to flush open file buffers on ctrl-C?
> 
> I realise I could do this with hSetBuffering though with some 
> performance cost.
> 
> I also appreciate that it could be a little tricky to implement (or,
> maybe, really simple?) - but it would be really useful.

Well, you can set up a signal handler for ctrl-C which flushes the
handles.  You'll have to keep track of the handles somehow - a top-level
IORef (aka global variable) would appear to be the easiest way, although
that would tend to keep the handles from being GC'd, so you'd need to
use weak pointers.

So, not entirely straightforward, but certainly not impossible.

Cheers,
        Simon

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to