Struct mft::attribute::x30::FileNameAttr
source · pub struct FileNameAttr {
pub parent: MftReference,
pub created: DateTime<Utc>,
pub modified: DateTime<Utc>,
pub mft_modified: DateTime<Utc>,
pub accessed: DateTime<Utc>,
pub logical_size: u64,
pub physical_size: u64,
pub flags: FileAttributeFlags,
pub reparse_value: u32,
pub name_length: u8,
pub namespace: FileNamespace,
pub name: String,
}
Fields§
§parent: MftReference
§created: DateTime<Utc>
§modified: DateTime<Utc>
§mft_modified: DateTime<Utc>
§accessed: DateTime<Utc>
§logical_size: u64
§physical_size: u64
§flags: FileAttributeFlags
§reparse_value: u32
§name_length: u8
§namespace: FileNamespace
§name: String
Implementations§
source§impl FileNameAttr
impl FileNameAttr
sourcepub fn from_stream<S: Read + Seek>(stream: &mut S) -> Result<FileNameAttr>
pub fn from_stream<S: Read + Seek>(stream: &mut S) -> Result<FileNameAttr>
Parse a Filename attrbiute buffer.
Example
Parse a raw buffer.
use mft::attribute::x30::{FileNameAttr, FileNamespace};
let attribute_buffer: &[u8] = &[
0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,
0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,
0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x03,0x24,0x00,0x4C,0x00,0x6F,0x00,0x67,0x00,0x46,0x00,0x69,0x00,0x6C,0x00,
0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00
];
let attribute = FileNameAttr::from_stream(&mut Cursor::new(attribute_buffer)).unwrap();
assert_eq!(attribute.parent.entry, 5);
assert_eq!(attribute.created.timestamp(), 1370144608);
assert_eq!(attribute.modified.timestamp(), 1370144608);
assert_eq!(attribute.mft_modified.timestamp(), 1370144608);
assert_eq!(attribute.accessed.timestamp(), 1370144608);
assert_eq!(attribute.logical_size, 67108864);
assert_eq!(attribute.physical_size, 67108864);
assert_eq!(attribute.flags.bits(), 6);
assert_eq!(attribute.reparse_value, 0);
assert_eq!(attribute.name_length, 8);
assert_eq!(attribute.namespace, FileNamespace::Win32AndDos);
assert_eq!(attribute.name, "$LogFile");
Trait Implementations§
source§impl Clone for FileNameAttr
impl Clone for FileNameAttr
source§fn clone(&self) -> FileNameAttr
fn clone(&self) -> FileNameAttr
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more