-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support chown
in eio_posix and eio_linux
#781
base: main
Are you sure you want to change the base?
Conversation
Adds support for fchownat to eio.unix and then calls this from eio_posix.
dbe9a44
to
9808d13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just use Unix.chown
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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
.