howto implement the getDirectoryContents by hand
27 Apr
2005
27 Apr
'05
9:36 a.m.
hi all, i even know there is a getDirectoryContents function in lib,but that's implemented by primitive function getDirContents,so i try to implement it use openDirStream,readDirStream but failed to recursive the contents, below is my try code: module Test1 where import System.Directory import System.Posix.Directory import Control.Monad dirName = "/home/wise/source/haskell" ls :: FilePath -> IO [FilePath] ls dname = do dirs <- openDirStream dname path <- readDirStream dirs return [path] -- so how to recursive this test = print =<< ls dirName any help is appreciated. Sun Yi Ming
7793
Age (days ago)
7793
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sun Yi Ming