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)
|
collect files dirs' (entry:entries)
|
||||||
| dirCruft entry = collect files dirs' entries
|
| dirCruft entry = collect files dirs' entries
|
||||||
| otherwise = do
|
| 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
|
case ms of
|
||||||
(Just s) | isDirectory s || (isSymbolicLink s && followsubdirsymlinks) ->
|
(Just s)
|
||||||
collect files (entry:dirs') entries
|
| isDirectory s -> recurse
|
||||||
_ ->
|
| isSymbolicLink s && followsubdirsymlinks ->
|
||||||
collect (entry:files) dirs' entries
|
ifM (doesDirectoryExist entry)
|
||||||
|
( recurse
|
||||||
|
, skip
|
||||||
|
)
|
||||||
|
_ -> skip
|
||||||
|
|
||||||
{- Moves one filename to another.
|
{- Moves one filename to another.
|
||||||
- First tries a rename, but falls back to moving across devices if needed. -}
|
- First tries a rename, but falls back to moving across devices if needed. -}
|
||||||
|
|
Loading…
Add table
Reference in a new issue