From a97fbcc40a6247bf59678425cf460588fd4dbecd Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 18 Apr 2024 21:40:22 -0700 Subject: [PATCH] Fixed: Improve paths longer than 256 on Windows failing to hardlink --- src/NzbDrone.Windows/Disk/DiskProvider.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NzbDrone.Windows/Disk/DiskProvider.cs b/src/NzbDrone.Windows/Disk/DiskProvider.cs index 97b73c607..a7a204a5e 100644 --- a/src/NzbDrone.Windows/Disk/DiskProvider.cs +++ b/src/NzbDrone.Windows/Disk/DiskProvider.cs @@ -170,6 +170,11 @@ namespace NzbDrone.Windows.Disk { try { + if (source.Length > 256 && !source.StartsWith(@"\\?\")) + { + source = @"\\?\" + source; + } + return CreateHardLink(destination, source, IntPtr.Zero); } catch (Exception ex)