mirror of
https://github.com/Lidarr/Lidarr
synced 2025-12-06 16:33:52 +01:00
Fixed: Improve paths longer than 256 on Windows failing to hardlink
(cherry picked from commit a97fbcc40a6247bf59678425cf460588fd4dbecd)
This commit is contained in:
parent
5f248aa25e
commit
580e4becbe
1 changed files with 5 additions and 0 deletions
|
|
@ -181,6 +181,11 @@ public override bool TryCreateHardLink(string source, string destination)
|
||||||
{
|
{
|
||||||
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…
Reference in a new issue