@@ -211,7 +211,7 @@ external eio_openat : Unix.file_descr option -> bool -> string -> Flags.Open.t -
211
211
let openat ?dirfd ?(nofollow =false ) ~sw path flags dis create =
212
212
with_dirfd " openat" dirfd @@ fun dirfd ->
213
213
Switch. check sw;
214
- in_worker_thread (fun () -> eio_openat dirfd nofollow path Flags.Open. (flags + cloexec (* + nonblock *) ) dis create)
214
+ in_worker_thread ~label: " openat " (fun () -> eio_openat dirfd nofollow path Flags.Open. (flags + cloexec (* + nonblock *) ) dis create)
215
215
|> Fd. of_unix ~sw ~blocking: false ~close_unix: true
216
216
217
217
let mkdir ?dirfd ?(nofollow =false ) ~mode :_ path =
@@ -223,25 +223,33 @@ external eio_unlinkat : Unix.file_descr option -> string -> bool -> unit = "caml
223
223
224
224
let unlink ?dirfd ~dir path =
225
225
with_dirfd " unlink" dirfd @@ fun dirfd ->
226
- in_worker_thread @@ fun () ->
226
+ in_worker_thread ~label: " unlink " @@ fun () ->
227
227
eio_unlinkat dirfd path dir
228
228
229
229
external eio_renameat : Unix .file_descr option -> string -> Unix .file_descr option -> string -> unit = " caml_eio_windows_renameat"
230
230
231
231
let rename ?old_dir old_path ?new_dir new_path =
232
232
with_dirfd " rename-old" old_dir @@ fun old_dir ->
233
233
with_dirfd " rename-new" new_dir @@ fun new_dir ->
234
- in_worker_thread @@ fun () ->
234
+ in_worker_thread ~label: " rename " @@ fun () ->
235
235
eio_renameat old_dir old_path new_dir new_path
236
236
237
237
238
238
external eio_symlinkat : string -> Unix .file_descr option -> string -> unit = " caml_eio_windows_symlinkat"
239
239
240
240
let symlink ~link_to new_dir new_path =
241
241
with_dirfd " symlink-new" new_dir @@ fun new_dir ->
242
- in_worker_thread @@ fun () ->
242
+ in_worker_thread ~label: " symlink " @@ fun () ->
243
243
eio_symlinkat link_to new_dir new_path
244
244
245
+ let chmod ~mode new_dir new_path =
246
+ with_dirfd " chmod" new_dir @@ fun new_dir ->
247
+ match new_dir with
248
+ | Some _ -> failwith " chmod not supported on Windows"
249
+ | None ->
250
+ in_worker_thread ~label: " chmod" @@ fun () ->
251
+ Unix. chmod new_path mode
252
+
245
253
let lseek fd off cmd =
246
254
Fd. use_exn " lseek" fd @@ fun fd ->
247
255
let cmd =
0 commit comments