Fixed: Improve paths longer than 256 on Windows failing to hardlink

(cherry picked from commit a97fbcc40a6247bf59678425cf460588fd4dbecd)
pull/9957/head
Mark McDowall 7 months ago committed by servarr
parent 04b6dd44cb
commit 642be7c82d

@ -170,6 +170,11 @@ namespace NzbDrone.Windows.Disk
{ {
try try
{ {
if (source.Length > 256 && !source.StartsWith(@"\\?\"))
{
source = @"\\?\" + source;
}
return CreateHardLink(destination, source, IntPtr.Zero); return CreateHardLink(destination, source, IntPtr.Zero);
} }
catch (Exception ex) catch (Exception ex)

Loading…
Cancel
Save