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

"Why not glob" entry misleading? #35

Closed
jayvdb opened this issue Nov 14, 2023 · 4 comments
Closed

"Why not glob" entry misleading? #35

jayvdb opened this issue Nov 14, 2023 · 4 comments

Comments

@jayvdb
Copy link

jayvdb commented Nov 14, 2023

glob searches for files in the current working directory, whereas globwalk starts at a specified base-dir.

Both seem to default to the current directory for their simplest API, and both have the option of using an absolute path.
e.g.

for entry in glob::glob("/media/**/*.jpg")
@Gilnaa
Copy link
Owner

Gilnaa commented Dec 20, 2023

IIRC this was written 6 years ago, before the current incarnation of the glob crate.
I am not sure there is any reason to use this crate over glob in modern times, I'll have to research this at some point, maybe recommend just using glob.

@Gilnaa
Copy link
Owner

Gilnaa commented Dec 21, 2023

It looks like there are a few options that are not available in glob, like limiting depth, filtering by file type, etc.
I'll update the readme to point out these differences and recommend just using glob unless they're absolutely needed.

@Gilnaa
Copy link
Owner

Gilnaa commented Dec 21, 2023

On second thought, and seeing this still-open-issue, it occurs to me that the significance is that you're able to set the directory without changing the glob pattern itself.

@Gilnaa
Copy link
Owner

Gilnaa commented Dec 23, 2023

After much thought, and in light of the linked glob issue, I think I'll keep this sentence.
I have, however, rewritten parts of the README.md to recommend new users to just use glob instead.

Thank you!

@Gilnaa Gilnaa closed this as completed Dec 23, 2023
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

No branches or pull requests

2 participants