public override FileSystemEntry GetEntry(string path) { FileRecord record = m_volume.GetFileRecord(path); if (record != null) { return(ToFileSystemEntry(path, record)); } else { return(null); } }
private void UpdateFileNameRecords() { List <FileNameRecord> fileNameRecords = m_fileRecord.FileNameRecords; foreach (FileNameRecord fileNameRecord in fileNameRecords) { fileNameRecord.AllocatedLength = this.Data.AllocatedLength; fileNameRecord.FileSize = this.Data.Length; } m_volume.UpdateFileRecord(m_fileRecord); // Update directory index MftSegmentReference parentDirectory = m_fileRecord.ParentDirectoryReference; FileRecord parentDirectoryRecord = m_volume.GetFileRecord(parentDirectory); IndexData parentDirectoryIndex = new IndexData(m_volume, parentDirectoryRecord, AttributeType.FileName); foreach (FileNameRecord fileNameRecord in fileNameRecords) { parentDirectoryIndex.UpdateFileNameRecord(fileNameRecord); } }
public override FileSystemEntry GetEntry(string path) { string streamName = GetStreamName(path); path = GetFilePath(path); FileRecord fileRecord = m_volume.GetFileRecord(path); if (streamName != String.Empty && fileRecord.GetAttributeRecord(AttributeType.Data, streamName) == null) { throw new FileNotFoundException(String.Format("The file '{0}' does not contain a stream named '{1}'", path, streamName)); } return(ToFileSystemEntry(path, fileRecord)); }
public NTFSFile(NTFSVolume volume, MftSegmentReference fileReference) : this(volume, volume.GetFileRecord(fileReference)) { }
public NTFSFile(NTFSVolume volume, MftSegmentReference fileReference) { m_volume = volume; m_fileRecord = m_volume.GetFileRecord(fileReference); }