Skip to content

Commit f3ff689

Browse files
dmbaturindamiendoligez
authored andcommitted
Fix Unix.utimes not working for directories on Win32. (#8796)
1 parent ae73b3f commit f3ff689

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ OCaml 4.12.0
262262

263263
### Other libraries:
264264

265+
- #8796: On Windows, make Unix.utimes use FILE_FLAG_BACKUP_SEMANTICS flag
266+
to allow it to work with directories.
267+
(Daniil Baturin, review by Damien Doligez)
268+
265269
* #9206, #9419: update documentation of the threads library;
266270
deprecate Thread.kill, Thread.wait_read, Thread.wait_write,
267271
and the whole ThreadUnix module.

otherlibs/win32unix/utimes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CAMLprim value unix_utimes(value path, value atime, value mtime)
5656
FILE_SHARE_READ | FILE_SHARE_WRITE,
5757
NULL,
5858
OPEN_EXISTING,
59-
0,
59+
FILE_FLAG_BACKUP_SEMANTICS,
6060
NULL);
6161
caml_leave_blocking_section();
6262
caml_stat_free(wpath);

0 commit comments

Comments
 (0)