File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ Unreleased
46
46
47
47
- Add support for instrumentation dependencies (#4210 , fixes #3983 , @nojb )
48
48
49
+ - Workaround incorrect exception raised by Unix.utimes (OCaml PR #8857 ) in
50
+ Path.touch on Windows (#4223 , @dra27 )
51
+
49
52
2.8.2 (21/01/2021)
50
53
------------------
51
54
Original file line number Diff line number Diff line change @@ -1176,9 +1176,19 @@ let touch ?(create = true) p =
1176
1176
| In_build_dir k ->
1177
1177
Kind. to_string (Kind. append_local (Fdecl. get Build. build_dir) k)
1178
1178
in
1179
- try Unix. utimes p 0.0 0.0
1180
- with Unix. Unix_error (Unix. ENOENT, _ , _ ) ->
1181
- if create then Unix. close (Unix. openfile p [ Unix. O_CREAT ] 0o777 )
1179
+ let create =
1180
+ if create then
1181
+ fun () ->
1182
+ Unix. close (Unix. openfile p [ Unix. O_CREAT ] 0o777 )
1183
+ else
1184
+ Fun. id
1185
+ in
1186
+ try Unix. utimes p 0.0 0.0 with
1187
+ | Unix. Unix_error (Unix. ENOENT, _ , _ ) -> create ()
1188
+ | Unix. Unix_error (Unix. EUNKNOWNERR 0 , _, _)
1189
+ when Sys. win32 && not (Sys. file_exists p) ->
1190
+ (* OCaml PR#8857 *)
1191
+ create ()
1182
1192
1183
1193
let compare x y =
1184
1194
match (x, y) with
You can’t perform that action at this time.
0 commit comments