diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-10-15 08:43:33 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-10-15 08:43:33 (GMT) |
commit | 18aaa568fd98ec6adcd58f65ffb1a9f6943cfe53 (patch) | |
tree | ebc8b8042c9c0f99937ff8de5231a6a1fb91cffe /Modules | |
parent | c9e82f62342b86583f0dd9f17e55da8a9d9a30e0 (diff) | |
download | cpython-18aaa568fd98ec6adcd58f65ffb1a9f6943cfe53.zip cpython-18aaa568fd98ec6adcd58f65ffb1a9f6943cfe53.tar.gz cpython-18aaa568fd98ec6adcd58f65ffb1a9f6943cfe53.tar.bz2 |
Patch #1576166: Support os.utime for directories on Windows NT+.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 93d0300..9e8bf8f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2458,7 +2458,8 @@ posix_utime(PyObject *self, PyObject *args) wpath = PyUnicode_AS_UNICODE(obwpath); Py_BEGIN_ALLOW_THREADS hFile = CreateFileW(wpath, FILE_WRITE_ATTRIBUTES, 0, - NULL, OPEN_EXISTING, 0, NULL); + NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, NULL); Py_END_ALLOW_THREADS if (hFile == INVALID_HANDLE_VALUE) return win32_error_unicode("utime", wpath); @@ -2473,7 +2474,8 @@ posix_utime(PyObject *self, PyObject *args) return NULL; Py_BEGIN_ALLOW_THREADS hFile = CreateFileA(apath, FILE_WRITE_ATTRIBUTES, 0, - NULL, OPEN_EXISTING, 0, NULL); + NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, NULL); Py_END_ALLOW_THREADS if (hFile == INVALID_HANDLE_VALUE) { win32_error("utime", apath); @@ -8617,3 +8619,4 @@ INITFUNC(void) } #endif + |