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 {