예제 #1
0
 public void CreateFileTree()
 {
     using (var testEnvironment = StreamTestEnvironment.FromExistingVhdx(true))
     {
         using (var filesystem = new ExFatPathFilesystem(testEnvironment.PartitionStream))
         {
             filesystem.CreateDirectory("a");
             using (var s = filesystem.Open(@"a\b.txt", FileMode.Create, FileAccess.ReadWrite))
                 s.WriteByte(66);
             using (var r = filesystem.Open(@"a\b.txt", FileMode.Open, FileAccess.Read))
             {
                 Assert.AreEqual(66, r.ReadByte());
                 Assert.AreEqual(-1, r.ReadByte());
             }
         }
     }
 }
예제 #2
0
 /// <inheritdoc />
 public override void CopyFile(string sourceFile, string destinationFile, bool overwrite)
 {
     using (var reader = _filesystem.Open(sourceFile, FileMode.Open, FileAccess.Read))
         using (var writer = _filesystem.Open(destinationFile, overwrite ? FileMode.Create : FileMode.CreateNew, FileAccess.Write))
             reader.CopyTo(writer);
 }