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:
When doing this on Linux via Wine, the same will happen but the link target (
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.
Here is the test setup:
- make test file where file is 100KB or greater.
...\src\test.txt
- Make folder with symlink back to (1)
...\link\test.txt
->...\src\test.txt
- Open WinSCP to a SFTP site with default settings. I my case, the SFTP site is running via Cygwin port on port 22.
- Navigate to local
...\link\test.txt
- Copy
...\link\test.txt
to remote site
- Copy back
test.txt
from remote to local
...\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.