Support chown in eio_posix and eio_linux#781
Support chown in eio_posix and eio_linux#781patricoferris wants to merge 8 commits intoocaml-multicore:mainfrom
chown in eio_posix and eio_linux#781Conversation
Adds support for fchownat to eio.unix and then calls this from eio_posix.
dbe9a44 to
9808d13
Compare
talex5
left a comment
There was a problem hiding this comment.
Thanks!
Rebasing on main should fix the OpenBSD CI error.
| let chown ?dirfd ~follow:_ ~uid ~gid path = | ||
| in_worker_thread @@ fun () -> | ||
| match dirfd with | ||
| | None -> failwith "Chown is unsupported on Windows" |
There was a problem hiding this comment.
Could just use Unix.chown here.
There was a problem hiding this comment.
Hmm I'm wondering whether chown should be in the cross-platform API at all.
Unix.chown isn't implemented on Windows:
https://github.com/ocaml/ocaml/blob/c484c6932fa2eae03ba0f5a7dbdb26e3eee65eb0/otherlibs/unix/unix_win32.ml#L450 -- it's not implemented in python's os.chown either?
Do we have a rule for what makes it into the cross-platform API and what doesn't ? I mean we already have File.Unix_perm.t.
There was a problem hiding this comment.
I think it's OK to keep it. We might want a proper operation-not-supported error at some point.
Co-authored-by: Thomas Leonard <talex5@gmail.com>
c1919aa to
4dd2863
Compare
Don't call Int64_val inside a blocking section.
|
BTW, I was planning to make a new Eio release tomorrow. Do you want me to delay that to get this in, or should I go ahead and merge this later? |
|
Oops sorry -- cut the release, no rush on this :)) |
This PR adds support to Eio for changing the ownership of a path using
fchownat.