diff --git a/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs b/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs index ebe6920..7720b64 100644 --- a/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs +++ b/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs @@ -31,7 +31,7 @@ public class UnixHardLinkFileService : IHardLinkFileService, IDisposable return (long)stat.st_nlink == 1 ? 0 : 1; } - // subtract the number of hardlinks in the same root directory + // get the number of hardlinks in the same root directory int linksInIgnoredDir = _inodeCounts.TryGetValue(stat.st_ino, out int count) ? count : 1; // default to 1 if not found diff --git a/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs b/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs index 70dd1ff..fde441d 100644 --- a/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs +++ b/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs @@ -37,12 +37,12 @@ public class WindowsHardLinkFileService : IHardLinkFileService, IDisposable // Get unique file ID (combination of high and low indices) ulong fileIndex = ((ulong)file.FileIndexHigh << 32) | file.FileIndexLow; - // Adjusted case: Check if there are links outside the ignored directory + // get the number of hardlinks in the same root directory int linksInIgnoredDir = _fileIndexCounts.TryGetValue(fileIndex, out int count) ? count - : 1; // Default to 1 if not found + : 1; // default to 1 if not found - _logger.LogDebug("stat file {file} | links: {links} | ignored: {ignored}", filePath, file.NumberOfLinks, linksInIgnoredDir); + _logger.LogDebug("stat file | hardlinks: {links} | ignored: {ignored} | {file}", file.NumberOfLinks, linksInIgnoredDir, filePath); return file.NumberOfLinks - linksInIgnoredDir; } catch (Exception exception)