Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listFilesRecursive loops on symlink loops #27

Open
knupfer opened this issue Jan 21, 2017 · 6 comments
Open

listFilesRecursive loops on symlink loops #27

knupfer opened this issue Jan 21, 2017 · 6 comments

Comments

@knupfer
Copy link

knupfer commented Jan 21, 2017

No description provided.

@ndmitchell
Copy link
Owner

Yep, that is almost inevitable. Any recommended suggestions? Documentation seems like a minimal first step.

@ndmitchell
Copy link
Owner

I added a note to the docs.

@knupfer
Copy link
Author

knupfer commented Jan 22, 2017

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).

@ndmitchell
Copy link
Owner

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?

@knupfer
Copy link
Author

knupfer commented Jan 22, 2017

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

@ndmitchell
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants