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

scandir(dir_fd) #108

Closed
ThomasWaldmann opened this issue Aug 6, 2018 · 5 comments
Closed

scandir(dir_fd) #108

ThomasWaldmann opened this issue Aug 6, 2018 · 5 comments

Comments

@ThomasWaldmann
Copy link
Contributor

ThomasWaldmann commented Aug 6, 2018

it looks like python (since 3.7) supports giving a directory fd to os.scandir instead of a directory path.

but python software can not really use that yet as having py37 as the minimum requirement is a bit too new for most systems out there.

if giving a dir_fd was supported by the scandir pypi module, could it be used for py 3.6 users instead of the builtin scandir?

@ThomasWaldmann
Copy link
Contributor Author

being able to use a dir_fd might improve performance as well as help with avoiding race conditions.

@ThomasWaldmann
Copy link
Contributor Author

ping?

@benhoyt
Copy link
Owner

benhoyt commented Feb 17, 2019

Hi @ThomasWaldmann, thanks for the report and ping. Unfortunately I have very little time to devote to scandir right now, so I can't add this personally. I would accept a solid PR if you have any interest in doing that?

There are several features missing from the latest Python 3.x version of scandir now, see for example #60. So in many ways it's probably better to take the latest Python 3.7 (or 3.8) source code and work backward from there.

Alternatively, if you're already on 3.6, it may just be easier to figure out how to upgrade to 3.7 and get these features from the stdlib version. Definitely easier than upgrading from 2.7. :-)

@benhoyt
Copy link
Owner

benhoyt commented Sep 25, 2021

As above, I still don't have a great deal of time/motivation to spend on updating scandir at this point (especially considering Python 3.7 is quite widespread now!). But if someone wants to submit a PR, I'm all ears, so I'll leave this open for now.

@benhoyt
Copy link
Owner

benhoyt commented Sep 25, 2021

Actually, I'm going to close this in favor of #60, and add a note about scandir(dir_fd) there.

@benhoyt benhoyt closed this as completed Sep 25, 2021
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