-
Notifications
You must be signed in to change notification settings - Fork 6
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
Tree predicates? #30
Comments
That's would be a really nice API addition! I agree it's super clunky to do that right now. |
an easy way to do this would be: !isempty(t[glob"my/file.ext"]) |
With a Lines 5 to 11 in 3a26a5c
Should that method be returning an empty tree instead? A couple of one-liner Base.in(g::GlobMatch, t::FileTree) = _glob_filter(t, name(t), g.pattern...) !== nothing
Base.in(p::PathLike, t::FileTree) = GlobMatch(string(p)) in t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(I might have completely overlooked it if it's already implemented?)
I'd like to check whether a given path exists in a
FileTree
, such asDoes anything like this currently exist? Or is there an idiomatic alternative that's reasonably efficient? There's the
getindex
methods that take globs or regex, but I'm just needing aBool
result given a path.The text was updated successfully, but these errors were encountered: