need to stat symlink
This commit is contained in:
parent
d088b37d75
commit
6e3cc0a228
1 changed files with 11 additions and 5 deletions
|
@ -60,12 +60,18 @@ dirContentsRecursiveSkipping skipdir followsubdirsymlinks topdir = go [topdir]
|
|||
collect files dirs' (entry:entries)
|
||||
| dirCruft entry = collect files dirs' entries
|
||||
| otherwise = do
|
||||
ms <- catchMaybeIO $ getFileStatus entry
|
||||
let skip = collect (entry:files) dirs' entries
|
||||
let recurse = collect files (entry:dirs') entries
|
||||
ms <- catchMaybeIO $ getSymbolicLinkStatus entry
|
||||
case ms of
|
||||
(Just s) | isDirectory s || (isSymbolicLink s && followsubdirsymlinks) ->
|
||||
collect files (entry:dirs') entries
|
||||
_ ->
|
||||
collect (entry:files) dirs' entries
|
||||
(Just s)
|
||||
| isDirectory s -> recurse
|
||||
| isSymbolicLink s && followsubdirsymlinks ->
|
||||
ifM (doesDirectoryExist entry)
|
||||
( recurse
|
||||
, skip
|
||||
)
|
||||
_ -> skip
|
||||
|
||||
{- Moves one filename to another.
|
||||
- First tries a rename, but falls back to moving across devices if needed. -}
|
||||
|
|
Loading…
Reference in a new issue