-
Notifications
You must be signed in to change notification settings - Fork 70
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
Feature request: Being able to #61
Comments
Actually, this functionality already exists in the configurable error callback.
My only recommendation at this point is to maybe move the documentation about the callback higher up in the readme and maybe define what the godirwalk.ErrorAction options are ? maybe even add a code sample ? |
For the sake of completeness and consistency, instead of the "return 1" on the error callback, use either: godirwalk.Halt // set to iota, i.e. 0
godirwalk.SkipNode // set to value next to iota, i.e. 1 At the time of writing this comment, no further options are being defined. See https://github.com/karrick/godirwalk/blob/master/walk.go#L90 (note: line number may change depending on the version) |
Hello again!
Yet again I find myself using godirwalk, just love this module <3
I was wondering if you could implement a way to detect if the current runtime does not have permissions to enter a folder.
Right now the Walk method just throws an error if I don't have permissions:
Here is my suggestion:
Add a function called "CanAccess" or something similar, that let's you check for persmissions inside the Walk method itself. This way you can combine HasAccess with SkipThis to quickly bypass closed off directories and/or files.
Example:
I figured since you're all up in this code, you might be able to do it in a few minutes but it might take me hours :S
The text was updated successfully, but these errors were encountered: