Closed ramwin closed 4 months ago
I think this is a good suggestion. I imagine it will involve wrapping the call to list the children of a folder in a try/except block. I will look into making this change
This functionality has been added in version 0.5.0. Relevant changes are in 61de607f1e740424e9ca2070dd705cfaaac02d15 and 83a6b07c2d95ee1908addd278f19522d0edd4cdb.
Two new parameters associated with this change are acceptable_listdir_errors
(what errors are okay to be ignored) and denied_string
(what string token to add to folders that can't be accessed).
Example:
>>> import seedir
>>> seedir.seedir('/Users/admin/', depthlimit=2)
admin/
├─Music/ [ACCESS DENIED]
├─.Box_UIServer
├─.CFUserTextEncoding
├─Pictures/ [ACCESS DENIED]
├─Desktop/ [ACCESS DENIED]
├─Library/ [ACCESS DENIED]
├─Public/
│ ├─.localized
│ └─Drop Box/ [ACCESS DENIED]
├─Movies/ [ACCESS DENIED]
├─.Box_EngineServer
├─Documents/ [ACCESS DENIED]
└─Downloads/ [ACCESS DENIED]
compare to tree
How about add a parameter like
errors="ignore"
?