Skip to content

Commit

Permalink
Improve paths longer than 256 on Windows failing to hardlink
Browse files Browse the repository at this point in the history
(cherry picked from commit a97fbcc40a6247bf59678425cf460588fd4dbecd)
  • Loading branch information
markus101 authored and mynameisbogdan committed Apr 28, 2024
1 parent eee21de commit ab7debb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/NzbDrone.Windows/Disk/DiskProvider.cs
Expand Up @@ -170,6 +170,11 @@ public override bool TryCreateHardLink(string source, string destination)
{
try
{
if (source.Length > 256 && !source.StartsWith(@"\\?\"))
{
source = @"\\?\" + source;
}

return CreateHardLink(destination, source, IntPtr.Zero);
}
catch (Exception ex)
Expand Down

0 comments on commit ab7debb

Please sign in to comment.