[−][src]Type Definition uefi::proto::media::file::FileInfo
type FileInfo = NamedFileProtocolInfo<FileInfoHeader>;
Generic file information
The following rules apply when using this struct with set_info()
:
- On directories, the file size is determined by the contents of the
directory and cannot be changed by setting
file_size
. This member is ignored byset_info()
. - The
physical_size
is determined by thefile_size
and cannot be changed. This member is ignored byset_info()
. - The
FileAttribute::DIRECTORY
bit cannot be changed. It must match the file’s actual type. - A value of zero in create_time, last_access, or modification_time causes the fields to be ignored (and not updated).
- It is forbidden to change the name of a file to the name of another existing file in the same directory.
- If a file is read-only, the only allowed change is to remove the read-only attribute. Other changes must be carried out in a separate transaction.
Implementations
impl FileInfo
[src]
pub fn new<'buf>(
storage: &'buf mut [u8],
file_size: u64,
physical_size: u64,
create_time: Time,
last_access_time: Time,
modification_time: Time,
attribute: FileAttribute,
file_name: &str
) -> Result<&'buf mut Self, FileInfoCreationError>
[src]
storage: &'buf mut [u8],
file_size: u64,
physical_size: u64,
create_time: Time,
last_access_time: Time,
modification_time: Time,
attribute: FileAttribute,
file_name: &str
) -> Result<&'buf mut Self, FileInfoCreationError>
Create a FileInfo
structure
The structure will be created in-place within the provided storage
buffer. The buffer must be large enough to hold the data structure,
including a null-terminated UCS-2 version of the name
string.
The buffer must be correctly aligned. You can query the required
alignment using the alignment()
method of the Align
trait that this
struct implements.
pub fn file_size(&self) -> u64
[src]
File size (number of bytes stored in the file)
pub fn physical_size(&self) -> u64
[src]
Physical space consumed by the file on the file system volume
pub fn create_time(&self) -> &Time
[src]
Time when the file was created
pub fn last_access_time(&self) -> &Time
[src]
Time when the file was last accessed
pub fn modification_time(&self) -> &Time
[src]
Time when the file's contents were last modified
pub fn attribute(&self) -> FileAttribute
[src]
Attribute bits for the file
pub fn file_name(&self) -> &CStr16
[src]
Name of the file