[Haskell-cafe] [Beginner's Question] How to read filenames from a
hanzhupeng at gmail.com
Sun Apr 8 22:46:14 EDT 2007
Newbie's question: I want to ls the filenames of a directory. The program in
C is something like:
struct dirent *dirp;
dp = opendir("/");
while((dirp = readdir(dp)) != NULL)
and I write that in haskell:
main = do
dp <- openDirStream "/"
df <- readDirStream dp
It can print the first entry of the dir, but how can we list it all like the
C prog? map ? list comperhension?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe