"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Duplicati/Library/Common/IO/SystemIOWindows.cs" between
duplicati-2.0.5.104-2.0.5.104_canary_2020-03-25.tar.gz and duplicati-2.0.5.106-2.0.5.106_canary_2020-05-11.tar.gz

About: Duplicati is a backup client that securely stores encrypted, incremental, compressed backups on local devices, cloud storage services and remote file servers (for Windows, macOS and Linux). A remark: This officially "pre-release" seems to run stable.

SystemIOWindows.cs  (duplicati-2.0.5.104-2.0.5.104_canary_2020-03-25):SystemIOWindows.cs  (duplicati-2.0.5.106-2.0.5.106_canary_2020-05-11)
skipping to change at line 195 skipping to change at line 195
{ {
if (!IsPathTooLong(path)) if (!IsPathTooLong(path))
try { return nativeIOFunc(path); } try { return nativeIOFunc(path); }
catch (System.IO.PathTooLongException) { } catch (System.IO.PathTooLongException) { }
catch (System.ArgumentException) { } catch (System.ArgumentException) { }
return !prefixWithUnc ? alternativeIOFunc(path) : alternativeIOFunc( PrefixWithUNC(path)); return !prefixWithUnc ? alternativeIOFunc(path) : alternativeIOFunc( PrefixWithUNC(path));
} }
#region ISystemIO implementation #region ISystemIO implementation
public void DirectoryDelete(string path)
{
PathTooLongActionWrapper(System.IO.Directory.Delete,
Alphaleonis.Win32.Filesystem.Directory.Dele
te, path, true);
}
public void DirectoryCreate(string path) public void DirectoryCreate(string path)
{ {
PathTooLongVoidFuncWrapper(System.IO.Directory.CreateDirectory, PathTooLongVoidFuncWrapper(System.IO.Directory.CreateDirectory,
Alphaleonis.Win32.Filesystem.Directory.Cr eateDirectory, path, true); Alphaleonis.Win32.Filesystem.Directory.Cr eateDirectory, path, true);
} }
public bool DirectoryExists(string path) public bool DirectoryExists(string path)
{ {
return PathTooLongFuncWrapper(System.IO.Directory.Exists, return PathTooLongFuncWrapper(System.IO.Directory.Exists,
Alphaleonis.Win32.Filesystem.Directory .Exists, path, true); Alphaleonis.Win32.Filesystem.Directory .Exists, path, true);
skipping to change at line 263 skipping to change at line 257
path, true); path, true);
} }
public System.IO.FileStream FileOpenWrite(string path) public System.IO.FileStream FileOpenWrite(string path)
{ {
return !FileExists(path) return !FileExists(path)
? FileCreate(path) ? FileCreate(path)
: PathTooLongFuncWrapper(System.IO.File.OpenWrite, Alphaleonis.W in32.Filesystem.File.OpenWrite, path, true); : PathTooLongFuncWrapper(System.IO.File.OpenWrite, Alphaleonis.W in32.Filesystem.File.OpenWrite, path, true);
} }
public System.IO.FileStream FileOpenReadWrite(string path)
{
return PathTooLongFuncWrapper(p => System.IO.File.Open(p, System.IO.
FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite, System.IO.FileShare.Read)
,
p => Alphaleonis.Win32.Filesystem.File.Open(p
, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read), path, true);
}
public System.IO.FileStream FileCreate(string path) public System.IO.FileStream FileCreate(string path)
{ {
return PathTooLongFuncWrapper(System.IO.File.Create, Alphaleonis.Win 32.Filesystem.File.Create, path, true); return PathTooLongFuncWrapper(System.IO.File.Create, Alphaleonis.Win 32.Filesystem.File.Create, path, true);
} }
public System.IO.FileAttributes GetFileAttributes(string path) public System.IO.FileAttributes GetFileAttributes(string path)
{ {
return PathTooLongFuncWrapper(System.IO.File.GetAttributes, AlphaFS. File.GetAttributes, path, true); return PathTooLongFuncWrapper(System.IO.File.GetAttributes, AlphaFS. File.GetAttributes, path, true);
} }
skipping to change at line 359 skipping to change at line 347
PathTooLongActionWrapper(p => System.IO.Directory.SetLastWriteTimeUt c(p, time), PathTooLongActionWrapper(p => System.IO.Directory.SetLastWriteTimeUt c(p, time),
p => Alphaleonis.Win32.Filesystem.File.SetL astWriteTimeUtc(p, time), path, true); p => Alphaleonis.Win32.Filesystem.File.SetL astWriteTimeUtc(p, time), path, true);
} }
public void DirectorySetCreationTimeUtc(string path, DateTime time) public void DirectorySetCreationTimeUtc(string path, DateTime time)
{ {
PathTooLongActionWrapper(p => System.IO.Directory.SetCreationTimeUtc (p, time), PathTooLongActionWrapper(p => System.IO.Directory.SetCreationTimeUtc (p, time),
p => Alphaleonis.Win32.Filesystem.File.SetC reationTimeUtc(p, time), path, true); p => Alphaleonis.Win32.Filesystem.File.SetC reationTimeUtc(p, time), path, true);
} }
public DateTime DirectoryGetLastWriteTimeUtc(string path)
{
return PathTooLongFuncWrapper(System.IO.Directory.GetLastWriteTimeUt
c,
Alphaleonis.Win32.Filesystem.Directory
.GetLastWriteTimeUtc, path, true);
}
public DateTime DirectoryGetCreationTimeUtc(string path)
{
return PathTooLongFuncWrapper(System.IO.Directory.GetCreationTimeUtc
,
Alphaleonis.Win32.Filesystem.Directory
.GetCreationTimeUtc, path, true);
}
public void FileMove(string source, string target) public void FileMove(string source, string target)
{ {
// We do not check if path is too long on target. If so, then we cat ch an exception. // We do not check if path is too long on target. If so, then we cat ch an exception.
PathTooLongActionWrapper(p => System.IO.File.Move(p, target), PathTooLongActionWrapper(p => System.IO.File.Move(p, target),
p => Alphaleonis.Win32.Filesystem.File.Move (p, PrefixWithUNC(target)), p => Alphaleonis.Win32.Filesystem.File.Move (p, PrefixWithUNC(target)),
source, true); source, true);
} }
public long FileLength(string path) public long FileLength(string path)
{ {
return PathTooLongFuncWrapper(p => new System.IO.FileInfo(p).Length, return PathTooLongFuncWrapper(p => new System.IO.FileInfo(p).Length,
p => new Alphaleonis.Win32.Filesystem. FileInfo(p).Length, p => new Alphaleonis.Win32.Filesystem. FileInfo(p).Length,
path, true); path, true);
} }
public void DirectoryDelete(string path, bool recursive)
{
PathTooLongActionWrapper(p => System.IO.Directory.Delete(p, recursiv
e),
p => Alphaleonis.Win32.Filesystem.Directory
.Delete(p, recursive),
path, true);
}
public string GetPathRoot(string path) public string GetPathRoot(string path)
{ {
return PathTooLongFuncWrapper(Path.GetPathRoot, AlphaFS.Path.GetPath Root, path, false); return PathTooLongFuncWrapper(Path.GetPathRoot, AlphaFS.Path.GetPath Root, path, false);
} }
public string[] GetDirectories(string path) public string[] GetDirectories(string path)
{ {
return PathTooLongFuncWrapper(Directory.GetDirectories, AlphaFS.Dire ctory.GetDirectories, path, false); return PathTooLongFuncWrapper(Directory.GetDirectories, AlphaFS.Dire ctory.GetDirectories, path, false);
} }
 End of changes. 4 change blocks. 
41 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)