Zig Version
0.15.0-dev.171+1b62a2226
Steps to Reproduce and Observed Behavior
File.open only allows specifying the modes read, write, or create. However these enumerations are for the individual bitfield values, and UEFI only allows specifying read, read|write or read|write|create.
File.getInfo and File.setInfo use the size of the struct, however Info.File, Info.FileSystem, and Info.VolumeLabel are all structs that have a variable width string appended to the end, so @sizeOf does not provide the real size of the data. This means that getInfo will always return Error.BufferTooSmall and setInfo will always return Error.BadBufferSize.
Expected Behavior
File.open's OpenMode should probably just provide enumerations for read, read|write and read|write|create.
File.getInfo needs to accept a buffer large than the Info.* struct, the helper method to read the attached string already exists.
File.setInfo needs to accept an Info.* larger than @sizeOf that struct. A helper method should likely be added to help construct these types.
Zig Version
0.15.0-dev.171+1b62a2226
Steps to Reproduce and Observed Behavior
File.openonly allows specifying the modesread,write, orcreate. However these enumerations are for the individual bitfield values, and UEFI only allows specifyingread,read|writeorread|write|create.File.getInfoandFile.setInfouse the size of the struct, howeverInfo.File,Info.FileSystem, andInfo.VolumeLabelare all structs that have a variable width string appended to the end, so@sizeOfdoes not provide the real size of the data. This means thatgetInfowill always returnError.BufferTooSmallandsetInfowill always returnError.BadBufferSize.Expected Behavior
File.open'sOpenModeshould probably just provide enumerations forread,read|writeandread|write|create.File.getInfoneeds to accept a buffer large than theInfo.*struct, the helper method to read the attached string already exists.File.setInfoneeds to accept anInfo.*larger than@sizeOfthat struct. A helper method should likely be added to help construct these types.