Does WinSCP lock the file during SFTP?

Advertisement

jkoser1
Joined:
Posts:
1

Does WinSCP lock the file during SFTP?

Hi.

We are currently trying to transfer files using WinSCP SFTP protocol. We are having a problem with the vendor pulling the file before we are able to remove the .filepart extension. Does WinSCP lock the file during file transfer and when does it release it - when the file is completely transferred and the .filepart extension removed, or does it release it when the file is transferred and then attempt to pull it again to do the rename/stripping of the filepart extension?

Thanks for your help.

Reply with quote

Advertisement

TimU
Joined:
Posts:
23
Location:
Sydney

Re: Does WinSCP lock the file during SFTP?

Good question! Something I hadn't considered in my implementation.
Martin, keen to hear your response please :)

The best reference I could find is way back from the v3.2 release notes:
Uploaded partial file (with .filepart extension) is renamed to target name only after file is closed (SFTP only). This should eliminate problems on servers, where file locking is supported (Windows).
This seems to indicate that the file lock is very much an S/FTP server function, rather than a WinSCP option... Which makes sense.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,506
Location:
Prague, Czechia

Re: Does WinSCP lock the file during SFTP?

Short answer: No.

Longer one:
WinSCP does not lock the file explicitly. Obviously particular implementation of the SFTP server may lock the file, when it is being accessed by SFTP client (WinSCP). It would be perfectly reasonable to do so.

SFTP client can lock the file explicitly with SFTP version 5. WinSCP does not support that yet. And note that the most widely used SFTP server, OpenSSH, does support SFTP version 3 only anyway.

Reply with quote

Advertisement

You can post new topics in this forum