io_interface: implement fileSetLength
This commit is contained in:
@@ -1012,10 +1012,12 @@ fn fileSupportsAnsiEscapeCodes(userdata: ?*anyopaque, file: File) Cancelable!boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn fileSetLength(userdata: ?*anyopaque, file: File, length: u64) File.SetLengthError!void {
|
fn fileSetLength(userdata: ?*anyopaque, file: File, length: u64) File.SetLengthError!void {
|
||||||
_ = userdata;
|
const node: *Node = @ptrCast(@alignCast(userdata.?));
|
||||||
_ = file;
|
node.setFileLength(file.handle, @intCast(length)) catch |err| switch (err) {
|
||||||
_ = length;
|
error.InvalidHandle => return error.AccessDenied,
|
||||||
@panic("Not implemented yet");
|
error.OutOfMemory => return error.InputOutput,
|
||||||
|
error.Canceled => return error.Canceled,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fileSetOwner(userdata: ?*anyopaque, file: File, owner: ?File.Uid, group: ?File.Gid) File.SetOwnerError!void {
|
fn fileSetOwner(userdata: ?*anyopaque, file: File, owner: ?File.Uid, group: ?File.Gid) File.SetOwnerError!void {
|
||||||
|
|||||||
Reference in New Issue
Block a user