|
|
@ -190,16 +190,23 @@ namespace NzbDrone.Common.Disk
|
|
|
|
|
|
|
|
|
|
|
|
var fi = new FileInfo(path);
|
|
|
|
var fi = new FileInfo(path);
|
|
|
|
|
|
|
|
|
|
|
|
// If the file is a symlink, resolve the target path and get the size of the target file.
|
|
|
|
try
|
|
|
|
if (fi.Attributes.HasFlag(FileAttributes.ReparsePoint))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var targetPath = fi.ResolveLinkTarget(true)?.FullName;
|
|
|
|
// If the file is a symlink, resolve the target path and get the size of the target file.
|
|
|
|
|
|
|
|
if (fi.Attributes.HasFlag(FileAttributes.ReparsePoint))
|
|
|
|
if (targetPath != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fi = new FileInfo(targetPath);
|
|
|
|
var targetPath = fi.ResolveLinkTarget(true)?.FullName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (targetPath != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fi = new FileInfo(targetPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (IOException ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Logger.Trace(ex, "Unable to resolve symlink target for {0}", path);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return fi.Length;
|
|
|
|
return fi.Length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|