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: WinSCP Clobbers Symlinks that for 100KB + Files

Ok, it makes sense now. I've edited your original post, with how I now understand it.

You want to turn off the automatic transfer resume:
https://winscp.net/eng/docs/resume#automatic

When uploading, WinSCP detects the symlinks and disables the feature when uploading to a symlink. But it does not do the same when downloading.
This feature request is now tracked here:
Issue 2184 – Do not enable resumable download when the target is symbolic link
You can vote for it.
JsD

Re: WinSCP Clobbers Symlinks that for 100KB + Files

What I mean with ~/link/test.txt is just <some_path>\link\test.txt for Windows client test and <some_path>/link/test.txt when testing on Linux client test. I should have written ...\link\test.txt.
martin

Re: WinSCP Clobbers Symlinks that for 100KB + Files

Thanks for your report.
What does it mean "Navigate to local ~/link/test.txt"? Are you emulating Linux on Windows? Or are you accessing Linux files from Windows? Or is it Windows symbolic link?
JsD

WinSCP Clobbers Symlinks that for 100KB + Files

When using WinSCP in SFTP mode and copying a remote file to local where the local copy is a symbolic link, the symbolic link will get converted to a hard file when the file size is exactly 100KB or more. Worse yet, on linux it will actually delete the symlink target.

Here is the test setup:

  1. make test file where file is 100KB or greater.
    ...\src\test.txt
  2. Make folder with symlink back to (1)
    ...\link\test.txt -> ...\src\test.txt
  3. Open WinSCP to a SFTP site with default settings. I my case, the SFTP site is running via Cygwin port on port 22.
  4. Navigate to local ...\link\test.txt
  5. Copy ...\link\test.txt to remote site
  6. Copy back test.txt from remote to local

At this point, ...\link\test.txt is no longer a symlink but an actual file. However, if the file is < 100KB, it will still be a symlink.

When doing this on Linux via Wine, the same will happen but the link target (...\src\test.txt) file is now DELETED from the filesystem!

I ran tests on fully updated Windows Server 2016 Standard and Ubuntu 22.04 (wine 6.x and 8.0). On Wine, I tested all the way back to 5.11.3 and had the same behavior so this must be a really old issue.

Workaround: Don't use SFTP but instead use SCP.