classification
Title: Add posix.fdlistdir
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Chris.Gerhard, anacrolix, benjamin.peterson, christian.heimes, daniel.urban, loewis, pitrou, rosslagerwall
Priority: normal Keywords: patch

Created on 2010-12-22 07:26 by rosslagerwall, last changed 2011-02-25 23:41 by pitrou. This issue is now closed.

Files
File name Uploaded Description Edit
i_fdlistdir.patch rosslagerwall, 2010-12-22 07:26 Patch to add posix.fdlistdir
i10755.patch rosslagerwall, 2010-12-23 04:52 Updated patch
Messages (5)
msg124489 - (view) Author: Ross Lagerwall (rosslagerwall) (Python committer) Date: 2010-12-22 07:26
Along with #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.
msg124491 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-12-22 08:21
What's the use case for this function?
msg124493 - (view) Author: Ross Lagerwall (rosslagerwall) (Python committer) Date: 2010-12-22 08:43
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 #4489.
msg124538 - (view) Author: Ross Lagerwall (rosslagerwall) (Python committer) Date: 2010-12-23 04:52
Hi,

Attached is a slightly updated patch that improves doc and changes fdlistdir to always return strings, not bytes.
msg129471 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-25 23:41
Committed in r88625. Thank you!
History
Date User Action Args
2011-02-25 23:41:43pitrousetstatus: open -> closed
nosy: loewis, pitrou, christian.heimes, benjamin.peterson, daniel.urban, anacrolix, Chris.Gerhard, rosslagerwall
messages: + msg129471

resolution: fixed
stage: resolved
2011-01-05 18:48:07pitroulinkissue4489 dependencies
2010-12-23 04:52:48rosslagerwallsetfiles: + i10755.patch
nosy: loewis, pitrou, christian.heimes, benjamin.peterson, daniel.urban, anacrolix, Chris.Gerhard, rosslagerwall
messages: + msg124538
2010-12-22 08:43:44rosslagerwallsetnosy: loewis, pitrou, christian.heimes, benjamin.peterson, daniel.urban, anacrolix, Chris.Gerhard, rosslagerwall
messages: + msg124493
2010-12-22 08:21:52loewissetnosy: loewis, pitrou, christian.heimes, benjamin.peterson, daniel.urban, anacrolix, Chris.Gerhard, rosslagerwall
messages: + msg124491
2010-12-22 07:26:12rosslagerwallcreate