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