Posix.createPipe failing

Keean k.schupke@ic.ac.uk
Sun, 13 Apr 2003 12:22:55 +0100


What you can do is return the data from the lazy read strictly, and the
close the file handle. using the Strategies library you get something like:

	a <- hGetContents h
	b <- return $ processInput a
	rnf a `seq` hClose h

Sometimes even this does not appear to be strict enough (in my experiance
when
processInput includes operations like map, then you have to "rnf" the data
before the
map as well. Sometimes I end up passing the file handle with the stream, to
enable me
to close it as soon as possible.

	Regards,
	Keean Schupke.

-----Original Message-----
From: glasgow-haskell-users-admin@haskell.org
[mailto:glasgow-haskell-users-admin@haskell.org]On Behalf Of Hal Daume
III
Sent: 11 April 2003 20:11
To: GHC Users Mailing List
Subject: Posix.createPipe failing


After running a few hundred createPipe's, they begin to fail for me,
giving the error:


Fail: system error
Action: createPipe


This seems to me to be like the "not enough file handles" error you get
when using lazy readFile, since this doesn't close the handle soon
enough.  Am I correct in this intuition and if I am (or otherwise), how do
I fix it?

Thanks!

 - Hal

--
 Hal Daume III                                   | hdaume@isi.edu
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users