public NtfsFileStream(NtfsFileSystem fileSystem, DirectoryEntry entry, AttributeType attrType, string attrName, FileAccess access)
        {
            _entry = entry;

            _file = fileSystem.GetFile(entry.Reference);
            _baseStream = _file.OpenStream(attrType, attrName, access);
        }
Пример #2
0
        private static void UpdateStandardInformation(DirectoryEntry dirEntry, File file, StandardInformationModifier modifier)
        {
            // Update the standard information attribute - so it reflects the actual file state
            NtfsStream stream = file.GetStream(AttributeType.StandardInformation, null);
            StandardInformation si = stream.GetContent<StandardInformation>();
            modifier(si);
            stream.SetContent(si);

            // Update the directory entry used to open the file, so it's accurate
            dirEntry.UpdateFrom(file);

            // Write attribute changes back to the Master File Table
            file.UpdateRecordInMft();
        }
Пример #3
0
 public void UpdateEntry(DirectoryEntry entry)
 {
     Index[entry.Details] = entry.Reference;
     UpdateRecordInMft();
 }