about summary refs log tree commit diff
path: root/library/std/src/sys/fs/uefi.rs
AgeCommit message (Collapse)AuthorLines
2025-06-05Optimize `Seek::stream_len` impl for `File`Tobias Bucher-0/+4
It uses the file metadata on Unix with a fallback for files incorrectly reported as zero-sized. It uses `GetFileSizeEx` on Windows. This reduces the number of syscalls needed for determining the file size of an open file from 3 to 1.
2025-05-01Change signature of File::try_lock and File::try_lock_sharedChristopher Berner-2/+3
These methods now return Result<(), TryLockError> instead of Result<bool, Error> to make their use less errorprone
2025-03-24std: fs: uefi: Implement OpenOptionsAyush Singh-8/+58
UEFI does not have specific modes for create_new, truncate and append. So those need to to be simulated after opening the file. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-24std: fs: uefi: Make lstat call statAyush Singh-2/+2
- UEFI does not have symlinks. So lstat and stat should behave the same. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-24std: fs: uefi: Implement canonicalizeAyush Singh-2/+2
- Should be same as absolute in UEFI since there are no symlinks. - Also each absolute path representation should be unique according to the UEFI specification. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-18std: uefi: fs: Implement mkdirAyush Singh-4/+30
- Since there is no direct mkdir in UEFI, first check if a file/dir with same path exists and then create the directory. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-18uefi: fs: Implement existsAyush Singh-2/+138
Also adds the initial file abstractions. The file opening algorithm is inspired from UEFI shell. It starts by classifying if the Path is Shell mapping, text representation of device path protocol, or a relative path and converts into an absolute text representation of device path protocol. After that, it queries all handles supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL and opens the volume that matches the device path protocol prefix (similar to Windows drive). After that, it opens the file in the volume using the remaining pat. It also introduces OwnedDevicePath and BorrowedDevicePath abstractions to allow working with the base UEFI and Shell device paths efficiently. DevicePath in UEFI behaves like an a group of nodes laied out in the memory contiguously and thus can be modeled using iterators. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-10uefi: fs: Partially implement FileAttrAyush Singh-15/+11
- Just the permission and file type. - FileTimes will need some new conversion functions and thus will come with a future PR. Trying to keep things simple here. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-10uefi: fs: Implement FileTypeAyush Singh-30/+10
- Similar to FilePermissions, using bool to represent the bitfield. - FileType cannot be changed, so no need to worry about converting back to attribute. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-10uefi: fs: Implement FilePermissionAyush Singh-21/+16
- UEFI file permissions are indicated using a u64 bitfield used for readonly/filetype, etc. - Using normal bool with to and from attribute conversions to FilePermission from overriding some other bitfields. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-08Move fs into sysThalia Archibald-0/+348