Skip to content

Commit

Permalink
Merge a381581 into 1f22eba
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkkrp committed Jun 16, 2017
2 parents 1f22eba + a381581 commit db58d82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Path/IO.hs
Expand Up @@ -99,6 +99,7 @@ module Path.IO
, getModificationTime )
where

import Control.Arrow ((***))
import Control.Monad
import Control.Monad.Catch
import Control.Monad.IO.Class (MonadIO (..))
Expand All @@ -111,6 +112,7 @@ import Data.Time (UTCTime)
import Path
import System.IO (Handle)
import System.IO.Error (isDoesNotExistError)
import qualified Data.DList as DList
import qualified Data.Set as S
import qualified System.Directory as D
import qualified System.FilePath as F
Expand Down Expand Up @@ -335,9 +337,12 @@ listDir path = do
listDirRecur :: (MonadIO m, MonadThrow m)
=> Path b Dir -- ^ Directory to list
-> m ([Path Abs Dir], [Path Abs File]) -- ^ Sub-directories and files
listDirRecur = walkDirAccum (Just excludeSymlinks) (\_ d f -> return (d, f))
where excludeSymlinks _ subdirs _ =
liftM WalkExclude (filterM isSymlink subdirs)
listDirRecur dir = (DList.toList *** DList.toList)
`liftM` walkDirAccum (Just excludeSymlinks) writer dir
where
excludeSymlinks _ subdirs _ =
WalkExclude `liftM` filterM isSymlink subdirs
writer _ ds fs = return (DList.fromList ds, DList.fromList fs)

-- | Copies a directory recursively. It /does not/ follow symbolic links and
-- preserves permissions when possible. If the destination directory already
Expand Down
1 change: 1 addition & 0 deletions path-io.cabal
Expand Up @@ -24,6 +24,7 @@ library
build-depends: base >= 4.7 && < 5.0
, containers
, directory >= 1.2.2 && < 1.4
, dlist >= 0.8 && < 0.9
, exceptions >= 0.8 && < 0.9
, filepath >= 1.2 && < 1.5
, path >= 0.5 && < 0.7
Expand Down

0 comments on commit db58d82

Please sign in to comment.