From 4516dc5d7083c10dd5b0884889c71c8d58f0ea56 Mon Sep 17 00:00:00 2001 From: Steve Ives Date: Thu, 27 Aug 2026 17:22:32 -0700 Subject: [PATCH] Potential bug fix for issue #3 re case-only directory name changes. --- SFTPSyncLib/RemoteSync.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SFTPSyncLib/RemoteSync.cs b/SFTPSyncLib/RemoteSync.cs index 0973ba5..463343d 100644 --- a/SFTPSyncLib/RemoteSync.cs +++ b/SFTPSyncLib/RemoteSync.cs @@ -364,7 +364,7 @@ private static async Task CreateDirectoriesInternal( return item.Name.Remove(item.Name.IndexOf(".DIR", StringComparison.OrdinalIgnoreCase)); else return item.Name; - }); + }, StringComparer.OrdinalIgnoreCase); foreach (var item in localDirectories) { @@ -741,6 +741,14 @@ private async void Fsw_DirectoryRenamed(object? sender, RenamedEventArgs arg) var oldRemotePath = GetRemotePathForLocal(arg.OldFullPath); var newRemotePath = GetRemotePathForLocal(arg.FullPath); + // OpenVMS directory names preserve case but are case-insensitive. A case-only + // local rename therefore refers to the same remote directory and needs no action. + if (string.Equals(oldRemotePath, newRemotePath, StringComparison.OrdinalIgnoreCase)) + { + Logger.LogInfo($"Ignoring case-only directory rename: {oldRemotePath} -> {newRemotePath}"); + return; + } + await _sftpLock.WaitAsync(); try {