Exemplo n.º 1
0
        public override FileSystemEntry GetEntry(string path)
        {
            FileRecord record = m_volume.GetFileRecord(path);

            if (record != null)
            {
                return(ToFileSystemEntry(path, record));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public NTFSFile(NTFSVolume volume, MftSegmentReference fileReference) : this(volume, volume.GetFileRecord(fileReference))
 {
 }
Exemplo n.º 5
0
 public NTFSFile(NTFSVolume volume, MftSegmentReference fileReference)
 {
     m_volume     = volume;
     m_fileRecord = m_volume.GetFileRecord(fileReference);
 }