Am 01.07.14 09:44, schrieb Victor Stinner:
scandir(fd) must not close the file descriptor, it should be done by
the caller. Handling the lifetime of the file descriptor is a
difficult problem, it's better to let the user decide how to handle
it.
This is an open issue still: when is the file
2014-07-01 8:44 GMT+01:00 Victor Stinner victor.stin...@gmail.com:
IMO we must decide if scandir() must support or not file descriptor.
It's an important decision which has an important impact on the API.
I don't think we should support it: it's way too complicated to use,
error-prone, and
2014-07-02 12:51 GMT+02:00 Charles-François Natali cf.nat...@gmail.com:
I don't think we should support it: it's way too complicated to use,
error-prone, and leads to messy APIs.
Can you please elaborate? Which kind of issue do you see? Handling the
lifetime of the directory file descriptor?
2014-07-02 12:51 GMT+02:00 Charles-François Natali cf.nat...@gmail.com:
I don't think we should support it: it's way too complicated to use,
error-prone, and leads to messy APIs.
Can you please elaborate? Which kind of issue do you see? Handling the
lifetime of the directory file descriptor?
Hi,
IMO we must decide if scandir() must support or not file descriptor.
It's an important decision which has an important impact on the API.
To support scandir(fd), the minimum is to store dir_fd in DirEntry:
dir_fd would be None for scandir(str).
scandir(fd) must not close the file
Thanks, Victor.
I don't have any experience with dir_fd handling, so unfortunately
can't really comment here.
What advantages does it bring? I notice that even os.listdir() on
Python 3.4 doesn't have anything related to file descriptors, so I'd
be in favour of not including support. We can
2014-07-01 14:26 GMT+02:00 Ben Hoyt benh...@gmail.com:
Thanks, Victor.
I don't have any experience with dir_fd handling, so unfortunately
can't really comment here.
What advantages does it bring? I notice that even os.listdir() on
Python 3.4 doesn't have anything related to file
Ben Hoyt benh...@gmail.com writes:
Thanks, Victor.
I don't have any experience with dir_fd handling, so unfortunately
can't really comment here.
What advantages does it bring? I notice that even os.listdir() on
Python 3.4 doesn't have anything related to file descriptors, so I'd
be in