[Haskell-cafe] ByteString or Text version of getDirectoryContents

Jesse Schalken jesseschalken at gmail.com
Sat Dec 18 07:38:07 CET 2010

Is there a ByteString or Text version of getDirectoryContents? I am writing
a program which scans a filesystem and it runs out of memory using Strings
for all the file names, and I would like to avoid the overhead of calling
ByteString.pack on the results of getDirectoryContents.

I don't mind if it only works on POSIX, but
System.Posix.Directory.readDirStream returns a String as well, and looking
at how readDirStream is implemented I am left puzzled as it looks like it is
using calls to native C functions but I can't find where the C string is
turned into a String so I can change it to a ByteString or Text.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20101218/076a7740/attachment.htm>

More information about the Haskell-Cafe mailing list