Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 694 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 694 Bytes

FileSystemTransaction

Simple file system transaction library for C#

Usage

Commit:

var fileTransaction = new FileSystemTransaction();
fileTransaction.Create("C:/test"); // Create new file/path
fileTransaction.Commit(); // Commit changes

Rollback:

var fileTransaction = new FileSystemTransaction();
fileTransaction.Create("C:/test"); // Create new file/path
fileTransaction.Write("C:/test/foo.txt", "Hello World"); // Write to file
fileTransaction.Commit(); // Commit changes
fileTransaction.Move("C:/test/foo.txt", "C:/foo.txt"); // Moves foo.txt file
fileTransaction.Rollback(); // Returns foo.txt file to C:/test directory