public Ntfs.NtfsFileSystem NtfsFileSystem() { SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096); SparseMemoryStream ms = new SparseMemoryStream(); Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024); return(Ntfs.NtfsFileSystem.Format(ms, "", diskGeometry, 0, diskGeometry.TotalSectorsLong)); }
private static DiscFileSystem FatFileSystem() { SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096); SparseMemoryStream ms = new SparseMemoryStream(); Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024); return(Fat.FatFileSystem.FormatFloppy(ms, FloppyDiskType.Extended, null)); }
public static DiscFileSystem DiagnosticNtfsFileSystem() { SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096); SparseMemoryStream ms = new SparseMemoryStream(); Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024); Ntfs.NtfsFileSystem.Format(ms, "", diskGeometry, 0, diskGeometry.TotalSectors); var discFs = new DiscUtils.Diagnostics.ValidatingFileSystem<Ntfs.NtfsFileSystem, Ntfs.NtfsFileSystemChecker>(ms); discFs.CheckpointInterval = 1; discFs.GlobalIOTraceCapturesStackTraces = false; return discFs; }
public static DiscFileSystem DiagnosticNtfsFileSystem() { SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096); SparseMemoryStream ms = new SparseMemoryStream(); Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024); Ntfs.NtfsFileSystem.Format(ms, "", diskGeometry, 0, diskGeometry.TotalSectorsLong); var discFs = new DiscUtils.Diagnostics.ValidatingFileSystem <Ntfs.NtfsFileSystem, Ntfs.NtfsFileSystemChecker>(ms); discFs.CheckpointInterval = 1; discFs.GlobalIOTraceCapturesStackTraces = false; return(discFs); }
public override SparseStream OpenFile(string path, FileMode mode, FileAccess access) { if (_files.ContainsKey(path)) { if (mode == FileMode.CreateNew) { throw new IOException("File already exists"); } return(new SparseMemoryStream(_files[path], access)); } else if (mode == FileMode.Create || mode == FileMode.CreateNew || mode == FileMode.OpenOrCreate || mode == FileMode.Truncate) { _files[path] = new SparseMemoryBuffer(16 * 1024); return(new SparseMemoryStream(_files[path], access)); } else { throw new FileNotFoundException(); } }
/// <summary> /// Creates a new instance using a pre-existing buffer. /// </summary> /// <param name="buffer">The buffer to use</param> /// <param name="access">The access permitted to clients</param> public SparseMemoryStream(SparseMemoryBuffer buffer, FileAccess access) : base(buffer, access) { }
/// <summary> /// Initializes a new instance of the SparseMemoryStream class. /// </summary> /// <param name="buffer">The buffer to use</param> /// <param name="access">The access permitted to clients</param> public SparseMemoryStream(SparseMemoryBuffer buffer, FileAccess access) : base(buffer, access) { }
public Ntfs.NtfsFileSystem NtfsFileSystem() { SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096); SparseMemoryStream ms = new SparseMemoryStream(); Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024); return Ntfs.NtfsFileSystem.Format(ms, "", diskGeometry, 0, diskGeometry.TotalSectors); }
private static DiscFileSystem FatFileSystem() { SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096); SparseMemoryStream ms = new SparseMemoryStream(); Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024); return Fat.FatFileSystem.FormatFloppy(ms, FloppyDiskType.Extended, null); }
public override SparseStream OpenFile(string path, FileMode mode, FileAccess access) { if (_files.ContainsKey(path)) { if(mode == FileMode.CreateNew) { throw new IOException("File already exists"); } return new SparseMemoryStream(_files[path], access); } else if(mode == FileMode.Create || mode == FileMode.CreateNew || mode == FileMode.OpenOrCreate || mode == FileMode.Truncate) { _files[path] = new SparseMemoryBuffer(16 * 1024); return new SparseMemoryStream(_files[path], access); } else { throw new FileNotFoundException(); } }