Source
pub fn open(
self: *const File,
file_name: [*:0]const u16,
mode: OpenMode,
create_attributes: Attributes,
) OpenError!*File {
var new: *File = undefined;
switch (self._open(
self,
&new,
file_name,
mode,
create_attributes,
)) {
.success => return new,
.not_found => return Error.NotFound,
.no_media => return Error.NoMedia,
.media_changed => return Error.MediaChanged,
.device_error => return Error.DeviceError,
.volume_corrupted => return Error.VolumeCorrupted,
.write_protected => return Error.WriteProtected,
.access_denied => return Error.AccessDenied,
.out_of_resources => return Error.OutOfResources,
.volume_full => return Error.VolumeFull,
.invalid_parameter => return Error.InvalidParameter,
else => |status| return uefi.unexpectedStatus(status),
}
}