Fixed a problem with long paths

This commit is contained in:
Kenneth Skovhede
2014-07-18 00:34:34 +02:00
parent 4a808f8821
commit 5430f4bfc4
3 changed files with 10 additions and 2 deletions
@@ -154,7 +154,7 @@ namespace Duplicati.Library.Main.Database
if (filecount != foundfiles)
{
var oldlen = maxpath.Length;
maxpath = System.IO.Path.GetDirectoryName(maxpath);
maxpath = Library.Snapshots.SnapshotUtility.SystemIO.PathGetDirectoryName(maxpath);
if (string.IsNullOrWhiteSpace(maxpath) || maxpath.Length == oldlen)
maxpath = "";
}
@@ -197,7 +197,7 @@ namespace Duplicati.Library.Main.Database
if (filecount != foundfiles)
{
var oldlen = maxpath.Length;
maxpath = System.IO.Path.GetDirectoryName(maxpath);
maxpath = Duplicati.Library.Snapshots.SnapshotUtility.SystemIO.PathGetDirectoryName(maxpath);
if (string.IsNullOrWhiteSpace(maxpath) || maxpath.Length == oldlen)
maxpath = "";
}
@@ -41,5 +41,13 @@ namespace Duplicati.Library.Snapshots
else
return new WindowsSnapshot(folders, options);
}
public static ISystemIO SystemIO
{
get
{
return Utility.Utility.IsClientLinux ? (ISystemIO)new SystemIOLinux() : (ISystemIO)new SystemIOWindows();
}
}
}
}