-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Make ipfs add -r
follow symlinks
#620
Conversation
If we're following symlinks, we might need cycle detection (what if you linked to the parent directory?). Also, might be better to only follow symlinks when a CLI flag is used ( |
Yeah, agreed with @mappum. |
Ok, so if we want to default to not follow symlinks, we'll have first to implement symlinks in unixfs. As for cycle detection, I'm sure this could be a good idea, but I don't think any other program out there does it. You shouldn't have cycles on your filesystem, period. Following symlinks is a natural behaviour, and you generally have to be explicit if you suspect there is a symlink and you don't want to follow it. Go is a kind of exception here with its So I think adding cycle detection would slow things down a lot and add too much complexity to the code to be worth implementing. |
@mildred most unix programs do actually do a sort of 'cycle detection' in counting how many symlinks theyve seen in the current resolution and failing if that number goes over a certain threshold. It costs pretty much nothing as its done in-line during the resolve. Implementing symlinks in unixfs is feasible, and should just be as simple as storing a path in the dag node. |
@mildred thanks for the PR! agree on both:
I'll let @whyrusleeping shepherd this one, as he's the |
ping @whyrusleeping |
If we can add a sharness test or two around this, that would be awesome. Otherwise, LGTM |
closing due to inactivity, please reopen as necessary note: all pull requests older than three weeks may be closed in an effort to keep our open pull requests more focused. |
clean up a channel that was dangling
Fix issue described in #616, symlinks are now followed by default.