Skip to content

Commit 961f377

Browse files
committed
Stub out chown on Eio_windows
1 parent 2c64c01 commit 961f377

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib_eio_windows/fs.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ end = struct
164164
with_parent_dir t path @@ fun dirfd path ->
165165
Err.run (Low_level.read_link ?dirfd) path
166166

167+
let chown ~follow ~uid ~gid t path =
168+
with_parent_dir t path @@ fun dirfd path ->
169+
Err.run (fun () -> Low_level.chown ?dirfd ~follow ~uid ~gid path) ()
170+
167171
let rename t old_path new_dir new_path =
168172
match Handler.as_posix_dir new_dir with
169173
| None -> invalid_arg "Target is not an eio_windows directory!"

lib_eio_windows/low_level.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ let read_link ?dirfd path =
138138
in_worker_thread @@ fun () ->
139139
Eio_unix.Private.read_link dirfd path
140140

141+
let chown ?dirfd ~follow:_ ~uid ~gid path =
142+
in_worker_thread @@ fun () ->
143+
Eio_unix.Private.chown ~flags:0 ~uid ~gid dirfd path
144+
141145
external eio_readv : Unix.file_descr -> Cstruct.t array -> int = "caml_eio_windows_readv"
142146

143147
external eio_preadv : Unix.file_descr -> Cstruct.t array -> Optint.Int63.t -> int = "caml_eio_windows_preadv"

lib_eio_windows/low_level.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ val lstat : string -> Unix.LargeFile.stats
4343

4444
val realpath : string -> string
4545
val read_link : ?dirfd:fd -> string -> string
46+
val chown : ?dirfd:fd -> follow:bool -> uid:int64 -> gid:int64 -> string -> unit
4647

4748
val mkdir : ?dirfd:fd -> ?nofollow:bool -> mode:int -> string -> unit
4849
val unlink : ?dirfd:fd -> dir:bool -> string -> unit

0 commit comments

Comments
 (0)