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));
        }
示例#3
0
 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();
     }
 }
示例#6
0
 /// <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)
 {
 }
示例#8
0
 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);
 }
示例#9
0
 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);
 }
示例#10
0
 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();
     }
 }