-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Add posix.fdlistdir #54964
Comments
Along with bpo-4761, the *at wrappers, it would be nice to have a patch adding the use of fdopendir. This patch adds a function fdlistdir, a unittest and documentation. |
What's the use case for this function? |
When maintaining an fd to implement a per thread current directory, you can use it to get a list of files in the directory. For security reasons, instead of a named path, you can keep an fd to a directory so that if the path is changed externally while performing an operation, the open fd still points to the original directory. This function then allows you to list the contents of that fd. I think this is needed for bpo-4489. |
Hi, Attached is a slightly updated patch that improves doc and changes fdlistdir to always return strings, not bytes. |
Committed in r88625. Thank you! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: