Closed CoDEmanX closed 9 years ago
Its cycle safe even with links.
see here. https://github.com/soldair/node-walkdir/blob/master/walkdir.js#L79
by the time it hits this line the symlink has be resolved to its actual path. if we have seen it already we stop recursing and dont emit it.
added a cycle to the unit test fixture to make sure this stays covered. https://github.com/soldair/node-walkdir/commit/e4a6f51e60c196dff68def96999290b7fb7c8ec2
Perfect, thanks!
Reading the description, there doesn't seem to be a built-in way to follow symlinks while detecting cycles and prevent infinite loops. I guess one could keep track of all encountered symlinks and ignore() them if they've been encountered before. It would still be nice to have this feature built-in, because it's a sensible default (would you ever want to follow a symlink twice?!)