Topic "Handling locked files"

Author Message
torix
[View user's profile]

Joined: 2015-11-11
Posts: 16
Location: Norway
We are utilizing WinSCP in conjunction with Powershell and Bitvise SSH Server and generally everything is working great. Our only problem seems to occur when transferring, and replacing, files that the user has opened and somewhat locked in e.g. Excel. In this situation we do not expect this solution to force an overwrite but just skip it and resume with the rest. What we observe is that the file transfer operation is aborted altogether and that subsequent files are missed. From start we ran with the resume option for these transfers but alter decided to disable it.

We have seen this when both using SynchronizeDirectories, Putfiles and GetFiles.

Anyone got similar experiences and solutions?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The only solution currently is to transfer files one-by-one and handle errors the way you need.

For an example, see https://winscp.net/eng/docs/library_example_recursive_download_custom_error_handling
torix
[View user's profile]

Joined: 2015-11-11
Posts: 16
Location: Norway
Thanks for the update and the solution you provided is in the same direction as I though of. Is this an issue that you will look into as an enhancement later? It would be better to track this situation in the events (transfer progress, file transferred) from the Error property.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Sure, I'm considering some improvements in this area.
torix
[View user's profile]

Joined: 2015-11-11
Posts: 16
Location: Norway
That's great. Although it is possible to work around this issue by looping each file, it will be better to handle it in the multi file methods internally. This will make the code more compact and it will ease the cleanup of empty folders if the move option is used.
torix
[View user's profile]

Joined: 2015-11-11
Posts: 16
Location: Norway
prikryl wrote:
Sure, I'm considering some improvements in this area.


Hi,

Will this start pointing us to a solution :
https://winscp.net/tracker/show_bug.cgi?id=1358


Regards
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
That's not really related.
torix
[View user's profile]

Joined: 2015-11-11
Posts: 16
Location: Norway
Until a permanent fix is available, we have mitigated by working through the folder content and transferring file for file.

Although read-only (RO) files are our worst enemy, we generally want to preserve the RO attribute from source to destination. In short - a file with the RO attribute set should have this attribute set on the destination file system. Our observation is that RO source files end up on the target file system with RO cleared. Is this by design or will certain class properties need to be set for this attribute to be maintained?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
WinSCP does not support preserving hidden attribute, when uploading, as very few servers do support it.

Though your server might support it actually.
torix
[View user's profile]

Joined: 2015-11-11
Posts: 16
Location: Norway
prikryl wrote:
WinSCP does not support preserving hidden attribute, when uploading, as very few servers do support it.

Though your server might support it actually.


Hi,

You mention the hidden attribute - I referred to the read-only attribute. I see that functionality to preserve RO is a selectable option in the GUI-application. Not avaliable through the .Net libraries?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Sorry for the mistake. It does not change my answer though.

The option is available for download only (even in GUI), not for upload.
torix
[View user's profile]

Joined: 2015-11-11
Posts: 16
Location: Norway
Ok, thanks.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License