Message164314
> I proposed making os.listdir accept dir_fd, and internally use open and listdir to emulate the behavior.
Hmm, I understood the issue as the request for adding dir_fd argument to
os.listdir. openat+fdopendir+readdir+closedir+close or, in Python,
def listdir2(path, dir_fd=None):
fd = os.open(path, dir_fd)
try:
return os.listdir(fd)
finally:
os.close(fd)
> But someone (Antoine?) rightly pointed out, this would break the guideline that POSIX os.* functions on Unix-y OSes are atomic.
os.listdir is not atomic. opendir+readdir+closedir+close or fdup
+fdopendir+readdir+closedir+close. |
|
Date |
User |
Action |
Args |
2012-06-29 05:58:23 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, larry, Arfrever, hynek |
2012-06-29 05:58:22 | serhiy.storchaka | link | issue15217 messages |
2012-06-29 05:58:22 | serhiy.storchaka | create | |
|