WinSCP indeed sends a bit contradictive request to "truncate file if it does not exist" (SSH_FXF_TRUNC + SSH_FXF_EXCL). But anyway, it is valid according to the SFTP spec and the server should fail the request if the file does exist. It indeed failes the request, but maybe it (incorrectly) truncates the file before failing.
Anyway, can you send me an email, so I can send you back a debug version of WinSCP if I manage to implement workaround? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.
> 2011-05-31 09:14:58.194 Type: SSH_FXP_OPEN, Size: 50, Number: 3843
> 2011-05-31 09:14:58.194 03,00,00,0F,03,00,00,00,19,2F,68,6F,6D,65,2F,70,63,33,34,31,33,33,2F,6E,6A,
> 2011-05-31 09:14:58.194 2F,74,65,73,74,2E,74,78,74,00,00,00,3A,00,00,00,01,00,00,00,00,00,00,00,4C,
< 2011-05-31 09:14:58.534 Type: SSH_FXP_STATUS, Size: 63, Number: 3843
< 2011-05-31 09:14:58.534 65,00,00,0F,03,00,00,00,04,00,00,00,2C,46,69,6C,65,20,65,78,69,73,74,73,2C,
< 2011-05-31 09:14:58.534 20,66,69,6C,65,3A,20,2F,68,6F,6D,65,2F,70,63,33,34,31,33,33,2F,6E,6A,2F,74,
< 2011-05-31 09:14:58.534 65,73,74,2E,74,78,74,00,00,00,02,65,6E,
< 2011-05-31 09:14:58.534 Status code: 4, Message: 3843, Server: File exists, file: /home/nathan/nj/test.txt, Language: en