Exemple #1
0
 public static void Wipe(Func <IDataSource> sourceFactory, string destinationPath, IProgress <int> progress, CancellationToken cancelToken)
 {
     using (var fileHandle = FileOpener.OpenPath(destinationPath, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
         using (var fileStream = new FileStream(fileHandle, FileAccess.ReadWrite))
         {
             Wipe(sourceFactory, fileStream, progress, cancelToken);
         }
 }
Exemple #2
0
 static SafeFileHandle OpenDevice(string path)
 {
     return(FileOpener.OpenPath(path.TrimEnd('\\'), FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite));
 }