#[non_exhaustive]pub struct FileInfo {
pub name: String,
pub end_of_file: u64,
pub allocation_size: u64,
pub creation_time: u64,
pub last_access_time: u64,
pub last_write_time: u64,
pub change_time: u64,
pub is_directory: bool,
pub read_only: bool,
pub file_index: u64,
}Expand description
Filesystem-style metadata for a single file or directory. Built with
FileInfo::new; every field is public.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringDisplay name (last component). For QUERY_INFO at the share root this is the share name.
end_of_file: u64File size in bytes.
allocation_size: u64Allocation size, usually end_of_file rounded up to a cluster.
Backends may return end_of_file.
creation_time: u64FILETIME (100ns ticks since 1601).
last_access_time: u64§last_write_time: u64§change_time: u64§is_directory: boolTrue if this is a directory.
read_only: boolThe file has FILE_ATTRIBUTE_READONLY.
file_index: u64Stable id of the file, unique within the share including any mounts
below the share root, reported as the file id by QUERY_INFO and
QUERY_DIRECTORY. Backends return the same value from Handle::stat
and Handle::list_dir for the same file, across opens and renames.
0 if the backend has none; the server then tells files apart by
path, so a file reached through two hard links counts as two files:
share modes, byte-range locks and leases taken through one name do
not see opens through the other, and clients on the two names can
both cache writes to it.
Implementations§
Source§impl FileInfo
impl FileInfo
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
A zero-length, writable file named name with no times and no file
id. Set the fields the backend knows.
Sourcepub fn attributes(&self) -> u32
pub fn attributes(&self) -> u32
SMB2 file attributes (MS-FSCC 2.6) for this file:
FILE_ATTRIBUTE_DIRECTORY for directories and
FILE_ATTRIBUTE_READONLY for read-only files.
FILE_ATTRIBUTE_NORMAL stands alone when neither applies.