1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-01-02 21:15:05 +00:00

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

(cherry picked from commit a97fbcc40a6247bf59678425cf460588fd4dbecd)
This commit is contained in:
Mark McDowall 2024-04-18 21:40:22 -07:00 committed by Bogdan
parent 5f248aa25e
commit 580e4becbe

View file

@ -181,6 +181,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)