Glob 0.3.1 → 0.3.2
raw patch · 5 files changed
+18/−8 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.txt +6/−0
- Glob.cabal +1/−1
- System/FilePath/Glob/Directory.hs +3/−0
- System/FilePath/Glob/Optimize.hs +1/−1
- System/FilePath/Glob/Utils.hs +7/−6
CHANGELOG.txt view
@@ -1,3 +1,9 @@+0.3.2, 2008-12-20:+ Regression fix: handle directories without read permissions properly.++ Convenience for developers: -XTemplateHaskell no longer barfs on+ Compile.hs.+ 0.3.1, 2008-10-31: Corrected the Cabal-Version field.
Glob.cabal view
@@ -1,7 +1,7 @@ Cabal-Version: >= 1.6 Name: Glob-Version: 0.3.1+Version: 0.3.2 Homepage: http://iki.fi/matti.niemenmaa/glob/ Synopsis: Globbing library Category: System
System/FilePath/Glob/Directory.hs view
@@ -40,6 +40,9 @@ -- -- Any results deeper than in the given directory are enumerated lazily, using -- 'unsafeInterleaveIO'.+--+-- Directories without read permissions are returned as entries but their+-- contents, of course, are not. globDir :: [Pattern] -> FilePath -> IO ([[FilePath]], [FilePath]) globDir [] dir = do c <- getRecursiveContents dir
System/FilePath/Glob/Optimize.hs view
@@ -62,7 +62,7 @@ | b > a = go $ CharRange True [Right (a,b)] : xs go (x:xs) =- case find ($x) compressors of+ case find ($ x) compressors of Just c -> x : go (dropWhile c xs) Nothing -> x : go xs
System/FilePath/Glob/Utils.hs view
@@ -124,16 +124,17 @@ #endif getRecursiveContents :: FilePath -> IO (DList FilePath)-getRecursiveContents dir = do- raw <- getDirectoryContents dir+getRecursiveContents dir =+ flip Prelude.catch (\_ -> return $ DL.singleton dir) $ do - let entries = map (dir </>) (raw \\ [".",".."])+ raw <- getDirectoryContents dir - (dirs,files) <- partitionM doesDirectoryExist entries+ let entries = map (dir </>) (raw \\ [".",".."])+ (dirs,files) <- partitionM doesDirectoryExist entries - subs <- unsafeInterleaveIO . mapM getRecursiveContents $ dirs+ subs <- unsafeInterleaveIO . mapM getRecursiveContents $ dirs - return$ DL.cons dir (DL.fromList files `DL.append` DL.concat subs)+ return$ DL.cons dir (DL.fromList files `DL.append` DL.concat subs) partitionM :: (Monad m) => (a -> m Bool) -> [a] -> m ([a], [a]) partitionM p_ = foldM (f p_) ([],[])