Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/ntfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/attribute.rs')
-rw-r--r--src/attribute.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/attribute.rs b/src/attribute.rs
index 17eb855..42762a1 100644
--- a/src/attribute.rs
+++ b/src/attribute.rs
@@ -145,6 +145,12 @@ impl<'n, 'f> NtfsAttribute<'n, 'f> {
))
}
+ /// Returns the identifier of this attribute that is unique within the [`NtfsFile`].
+ pub fn instance(&self) -> u16 {
+ let start = self.offset + offset_of!(NtfsAttributeHeader, instance);
+ LittleEndian::read_u16(&self.file.record_data()[start..])
+ }
+
/// Returns `true` if this is a resident attribute, i.e. one where its value
/// is part of the attribute structure.
pub fn is_resident(&self) -> bool {