Topic "request for info: how do the "preserve timestamp" and "temporary filename" settings coexist?"

Author Message
orlando.colamatteo
[View user's profile]

Joined: 2013-07-19
Posts: 2
Location: Denver, CO
If I am uploading a file and both "preserve timestamp" and "upload using temporary filename" are set to true, what is the sequence of events that occur during the lifecycle of the file upload?

e.g. is it 1) upload to temp filename, 2) reset timestamp on temporary file, 3) rename file to permanent filename

or is it 1) upload to temp filename, 2) rename file to permanent filename, 3) reset timestamp on permanent file

Thanks.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
The latter is true.
orlando.colamatteo
[View user's profile]

Joined: 2013-07-19
Posts: 2
Location: Denver, CO
I encountered a nasty scenario with an app where the upload completed but preserving the timestamp failed. because a failure was encountered my process later retried and it succeeded on all accounts, thereby delivering the file a second time. I know this is my issue, from a defensive programming perspective, but since the upload is to a temporary filename the rename seems like the safest possible last step in the critical path. therefore it would be nicer if the timestamp preservation happened before the rename from the temporary filename to the permanent filename. let me know if you agree, and if you would consider this as an enhancement please let me know how to submit it.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
I'm afraid that some servers will bump the timestamp with the rename operation.
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