[issue25996] Add support of file descriptor in os.scandir()

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25996] Add support of file descriptor in os.scandir()

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ea720fe7e99d68924deab38de955fe97f87e2b29 by Serhiy Storchaka in branch 'master': bpo-25996: Added support of file descriptors in os.scandir() on Unix. (#502) https://github.com/python/cpython/commit/ea720fe7e99d68924deab38de955fe97f87e2b29

[issue25996] Add support of file descriptor in os.scandir()

2017-03-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your investigation Eryk. Helpful as always. Since I have no access to Windows I left this feature Unix-only. -- ___ Python tracker

[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread Eryk Sun
Eryk Sun added the comment: > There is no similar function taking a directory handle In 3.5+ the CRT has O_OBTAIN_DIR (0x2000) for opening a directory, i.e. to call CreateFile with backup semantics. A directory can be read via GetFileInformationByHandleEx [1] using the information classes

[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread STINNER Victor
STINNER Victor added the comment: > I'm wondering is it possible to implement this feature on Windows? On Windows, scandir() is implemented with FindFirstFile() which takes strings. This function creates a handle which should then be passed to FindNextFile(). There is no similar function

[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm wondering is it possible to implement this feature on Windows? -- ___ Python tracker ___

[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +410 ___ Python tracker ___ ___

[issue25996] Add support of file descriptor in os.scandir()

2016-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Resolved conflicts in the documentation. -- Added file: http://bugs.python.org/file45554/os-scandir-fd-3.patch ___ Python tracker

[issue25996] Add support of file descriptor in os.scandir()

2016-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for the review Josh. Updated patch addresses your comments and adds yet few microoptimizations. -- Added file: http://bugs.python.org/file45462/os-scandir-fd-2.patch ___ Python tracker

[issue25996] Add support of file descriptor in os.scandir()

2016-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch adds support for file descriptors in os.scandir() and implements os.fwalk() with os.scandir(). The effect of using os.scandir() in os.fwalk(): $ ./python -m timeit -n1 -r5 -s 'import os' -- 'list(os.walk("/usr/lib"))' 1 loop, best of 5: 934

[issue25996] Add support of file descriptor in os.scandir()

2016-11-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka dependencies: +Convert os.scandir to Argument Clinic ___ Python tracker

[issue25996] Add support of file descriptor in os.scandir()

2016-05-22 Thread Evgeny Kapun
Changes by Evgeny Kapun : -- nosy: +abacabadabacaba ___ Python tracker ___ ___

[issue25996] Add support of file descriptor in os.scandir()

2016-01-02 Thread STINNER Victor
STINNER Victor added the comment: Supporting file descriptor was also discussed when pathlib.Path was designed, but there was similar questions on the lifetime of the file descriptor. (Who is able to close it? When? Is it ok to close it using os.close? etc.) --

[issue25996] Add support of file descriptor in os.scandir()

2016-01-02 Thread STINNER Victor
STINNER Victor added the comment: Yeah, it was discussed when the PEP 471 was designed, but it was already hard to design os.scandir() without supporting fd as os.scandir() parameter. It's more complex because we have to handle the lifetime of the file descriptor especially if it's exposed in