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()); } } } }
/// <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); }