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); }
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(); }
public void UpdateEntry(DirectoryEntry entry) { Index[entry.Details] = entry.Reference; UpdateRecordInMft(); }