Пример #1
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.TotalSectorsLong));
        }
Пример #2
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));
        }
Пример #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;
 }
Пример #4
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.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();
     }
 }