Get things building again
This commit is contained in:
parent
f8769d77bb
commit
6fb691b65d
5 changed files with 34 additions and 71 deletions
|
@ -1,3 +1,4 @@
|
|||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
-- |
|
||||
-- Module: System.FilePath.Glob
|
||||
-- Copyright: Bryan O'Sullivan
|
||||
|
@ -10,6 +11,7 @@ module System.FilePath.Glob (
|
|||
namesMatching
|
||||
) where
|
||||
|
||||
import Control.Exception
|
||||
import Control.Monad (forM)
|
||||
import System.FilePath.GlobPattern ((~~))
|
||||
import System.Directory (doesDirectoryExist, doesFileExist,
|
||||
|
@ -17,8 +19,6 @@ import System.Directory (doesDirectoryExist, doesFileExist,
|
|||
import System.FilePath (dropTrailingPathSeparator, splitFileName, (</>))
|
||||
import System.IO.Unsafe (unsafeInterleaveIO)
|
||||
|
||||
import System.FilePath.Error (handle)
|
||||
|
||||
-- | Return a list of names matching a glob pattern. The list is
|
||||
-- generated lazily.
|
||||
namesMatching :: String -> IO [FilePath]
|
||||
|
@ -49,7 +49,7 @@ listMatches dirName pat = do
|
|||
dirName' <- if null dirName
|
||||
then getCurrentDirectory
|
||||
else return dirName
|
||||
names <- unsafeInterleaveIO (handle (const (return [])) $
|
||||
names <- unsafeInterleaveIO (handle (\(_::IOException) -> return []) $
|
||||
getDirectoryContents dirName')
|
||||
let names' = if isHidden pat
|
||||
then filter isHidden names
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue