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

Follow symlinks in readdir() and readdirSync() #56

Merged
merged 1 commit into from
Aug 13, 2015

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Aug 12, 2015

Closes #14

@caitp
Copy link
Contributor Author

caitp commented Aug 12, 2015

Let me know if the indentation style used in tests aren't to your linking, not sure if the linter rules will complain if they're not.

This patch will resolve symlinks in the same way open() and stat() will, so I assume it's correct.

@caitp
Copy link
Contributor Author

caitp commented Aug 12, 2015

This isn't quite ready yet

caitp added a commit to caitp/cauliflower-filter that referenced this pull request Aug 12, 2015
@caitp
Copy link
Contributor Author

caitp commented Aug 12, 2015

This feels okay now

var name;
for (var i = 0, ii = parts.length; i < ii; ++i) {
name = parts[i];
if (item instanceof SymbolicLink) {
// Symbolic link being traversed as a directory
linkPath = path.resolve(path.dirname(itemPath), item.getPath());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there might be an issue here with <link> -> <link> -> <file>-type paths or something

@tschaub
Copy link
Owner

tschaub commented Aug 13, 2015

Thanks for this @caitp! It looks like there might be more work needed to recursively follow links, but I think this is a nice enhancement.

tschaub added a commit that referenced this pull request Aug 13, 2015
Follow symlinks in readdir() and readdirSync().
@tschaub tschaub merged commit ff3ea15 into tschaub:master Aug 13, 2015
@tschaub
Copy link
Owner

tschaub commented Aug 13, 2015

Published as [email protected].

@caitp
Copy link
Contributor Author

caitp commented Aug 13, 2015

Thanks for this @caitp! It looks like there might be more work needed to recursively follow links, but I think this is a nice enhancement.

I sent a followup with a bit more work on this portion --- I believe this matches the typical posix/libc behaviour, but I need to check that as it's been a while

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

Successfully merging this pull request may close these issues.

2 participants