// // Copyright (c) 2008-2011, Kenneth Bell // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // namespace DiscUtils.Ntfs.Internals { using System; /// /// Representation of an NTFS File Name attribute. /// /// /// The details in this attribute may be inconsistent with similar information in /// the FileNameAttribute(s) for a file. This attribute is definitive, the /// FileNameAttribute attribute holds a 'cache' of some of the information. /// public sealed class StandardInformationAttribute : GenericAttribute { private StandardInformation _si; internal StandardInformationAttribute(INtfsContext context, AttributeRecord record) : base(context, record) { byte[] content = Utilities.ReadAll(Content); _si = new StandardInformation(); _si.ReadFrom(content, 0); } /// /// Gets the creation time of the file. /// public DateTime CreationTime { get { return _si.CreationTime; } } /// /// Gets the modification time of the file. /// public DateTime ModificationTime { get { return _si.ModificationTime; } } /// /// Gets the last time the Master File Table entry for the file was changed. /// public DateTime MasterFileTableChangedTime { get { return _si.MftChangedTime; } } /// /// Gets the last access time of the file. /// public DateTime LastAccessTime { get { return _si.LastAccessTime; } } /// /// Gets the attributes of the file, as stored by NTFS. /// public NtfsFileAttributes FileAttributes { get { return (NtfsFileAttributes)_si.FileAttributes; } } /// /// Gets the maximum number of file versions (normally 0). /// public long MaxVersions { get { return _si.MaxVersions; } } /// /// Gets the version number of the file (normally 0). /// public long Version { get { return _si.Version; } } /// /// Gets the Unknown. /// public long ClassId { get { return _si.ClassId; } } /// /// Gets the owner identity, for the purposes of quota allocation. /// public long OwnerId { get { return _si.OwnerId; } } /// /// Gets the identifier of the Security Descriptor for this file. /// /// /// Security Descriptors are stored in the \$Secure meta-data file. /// public long SecurityId { get { return _si.SecurityId; } } /// /// Gets the amount charged to the owners quota for this file. /// public long QuotaCharged { get { return (long)_si.QuotaCharged; } } /// /// Gets the last update sequence number of the file (relates to the user-readable journal). /// public long JournalSequenceNumber { get { return (long)_si.UpdateSequenceNumber; } } } }