Open knupfer opened 7 years ago
I added a note to the docs.
I'd suggest that it doesn't follow symlinks. It seems weird to me that it could return the filepaths parent (if it would return).
That seems a plausible option, using https://hackage.haskell.org/package/directory-1.3.0.1/docs/src/System-Directory.html#pathIsSymbolicLink. Would you list files that are symbolic links? Or just not follow directories that were?
I'd just not follow directories. This will avoid the most severe class of bugs.
I can imagine that at least someone already did the following:
listFilesRecursively >>= mapM_ removeFile
If you have symlinks to the root or similar, then you probably get away with it because listFilesRecursively
will loop forever...
The behaviour of not following inside directories which are symlinks seems reasonable to me.
Yep, that is almost inevitable. Any recommended suggestions? Documentation seems like a minimal first step.