Jump to content

Walk a directory/Recursively: Difference between revisions

m
→‎{{header|Haskell}}: hlint, hindent.
m (→‎{{header|Haskell}}: Minor tidying, applied hlint, hindent.)
m (→‎{{header|Haskell}}: hlint, hindent.)
Line 1,005:
import System.FilePath.Find
 
search pat dir = find always (fileName ~~? pat)
find always (fileName ~~? pat) dir
 
main = do [pat] <- getArgs
[pat] <- getArgs
dir <- getCurrentDirectory
files <- search pat dir
mapM_ putStrLn files</lang>
or more classic way:
<lang haskell>import System.FilePath.Posix
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.