Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Race condition/path mix-up when batch executing custom commands with similar filenames

If you use "Compare directories", WinSCP will highlight/select the mismatched files. Not any pairs.

Instead, use Synchronize command and execute your custom command from the Synchronization checklist window:
https://winscp.net/eng/docs/ui_synchronize_checklist
lilhu

Re: Race condition/path mix-up when batch executing custom commands with similar filenames

Thank you for the clarification regarding ordinal sequence pairing.

However, the issue occurs specifically within the "Compare Directories" (Shift+F2) checklist window:

  1. I perform a directory comparison (Shift+F2) to filter the modified files.
  2. The list visually shows aligned, matching filenames on both local and remote panels.
  3. When I select multiple files from this comparison list and execute the custom command, the parameters ! and !^! still dispatch incorrect pairings (a file gets compared with a different file in the batch).

It seems that the custom command dispatch mechanism loses track of the 1-to-1 ordinal mapping when triggered from the directory comparison checklist view.
martin

Re: Race condition/path mix-up when batch executing custom commands with similar filenames

First, please note that the files are paired simply by their order, not by their name. If that does not explain the mix-up, please post some screenshots documenting it.
lilhu

Race condition/path mix-up when batch executing custom commands with similar filenames

When selecting multiple files with similar prefixes (e.g., inv_conf.html and investor_fin.html) to run a custom diff command using ! and !^!, WinSCP's background variable dispatch seems to suffer from a race condition or path mix-up. The external script often receives swapped or incorrect file paths.
Steps to reproduce:
Set up a local custom command using PowerShell to launch WinMerge with !^! and !.
Select multiple files with similar names in both panels (equal quantity).
Trigger the custom command.
Expected result: Each file pair should be mapped correctly.
Actual result: Paths are cross-contaminated (wrong files compared).