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

Upgrade from ftw() to nftw() #27

Open
NicMcPhee opened this issue Oct 7, 2021 · 2 comments
Open

Upgrade from ftw() to nftw() #27

NicMcPhee opened this issue Oct 7, 2021 · 2 comments
Assignees

Comments

@NicMcPhee
Copy link
Contributor

NicMcPhee commented Oct 7, 2021

To quote man ftw:

ftw() is an older function that offers a subset of the functionality of nftw().

and apparently it's been marked as obsolete.

So we probably replace the use of ftw with nftw here. It looks like it should be pretty simple, as ftw looks to be a simple subset of nftw in most ways.

Thanks to @helloworld12321 for the pointer!

@NicMcPhee NicMcPhee self-assigned this Sep 30, 2022
@NicMcPhee
Copy link
Contributor Author

Actually, now you're supposed to use fts instead of either of the (n)ftw variants.

I got this to work pretty easily (this example was super helpful).

I wonder if this would be a good place to switch to Rust, though, probably using the walkdir crate?

@helloworld12321
Copy link

helloworld12321 commented Oct 7, 2022

Might be worth mentioning that nftw is POSIX, whereas fts is an extension provided by Linux and a few other Unixes (like macOS). I don't know if that sways things in one direction or another. 🙂🤷🏻‍♂️

(Although a few sources mention that fts is being considered for inclusion in a future POSIX version.)

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