Topic "Local copies of edited files ?"

Author Message
obi

Guest


Hi. Fist I'd like to thank you for this great software. So great that I started to edit all the websites I am working on with the internal editor. I was working on a large PHP file, and as it happens quite often, lost the connection (I don't know if there is a time-out or if this is a proxy problem (BTW, I run WinSC 3.7.4 build 271). As I'm used to this happening, I save the file everytime I modify a few lines. Thus I reconnect and reopen the file. Empty Confused

What happened is that I saved just before loosing connection, so the destination file was overwritten, but not fulled of data yet. This is the second time it happens on me. The first was not grave, I had a recent back-up. This time, I just lost 3 days of work (3 days old back-up sucks). So I started to dig in the doc to find if I could be saved by a local cache copy. If I've understood, and what I've seen on my version, is that the local copy is deleted after closing the editor.

I might be wrong, please say-me that there is another copy , please ...

If it's not the case, here are some propositions, in random order:
1:delete local copy only if the server has acknowleded the COMPLETE file save
2:instead of overwriting the file, write to a temporary file, then move it over the destination file(don't know if this is possible with the protocol you use though)
3:Have an option to keep local copies of edited files a certain amount of time

Sorry, I do not have a log of what happened, did not find the option at this time. BTW I'm behind a proxy.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
obi wrote:
1:delete local copy only if the server has acknowleded the COMPLETE file save

Not bad idea. But I do not like leaving temporary files around system. Most users do not know about them at all, which has security implications when they are using WinSCP on shared computer. I'll consider it anyway.

Quote:
2:instead of overwriting the file, write to a temporary file, then move it over the destination file(don't know if this is possible with the protocol you use though)

This is exactly what WinSCP does to allow resume. You may try to misuse it for your purpose.

Quote:
3:Have an option to keep local copies of edited files a certain amount of time

Same as point 1.
_________________
Martin Prikryl
obi

Guest


prikryl wrote:
obi wrote:
1:delete local copy only if the server has acknowleded the COMPLETE file save

Not bad idea. But I do not like leaving temporary files around system. Most users do not know about them at all, which has security implications when they are using WinSCP on shared computer. I'll consider it anyway.


I understand that leaving cache on the disk is potentially dangerous. I propose the following scenario:
If you loose the connection while editing one or more files, in the dialog popping up, add a section asking what to do with cached files:
Radio buttons:
[delete]
[keep]
Check button:
[Remember this decision]
button :
[show cached files] (open an explorer window in the cache directory)

Moreover, you can add a specific message/beaviour if you do not have received the acknowledgement since the last save

Going on a different direction, when you loose connection while editing a file, and hit reconnect, you could check if there is a diff between the file still in the editor, and the one on the server. If not, the user should be able to continue typing in the opened editor, if not, ask what to do: keep in memory version/ take server version/ show server version (the best would be a diff, but I guess this is would be lot of work from your side).

If you want some help to implement one of these features, I could spend a few hours to put some code where my mouth is, depending of the complexity of the WinSCP Code. I just do not want to loose some code/time again, this is a luxury I can't afford.

BTW, thanks again for the hard work and the nice result.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
OK, I'll try to do something with this Smile
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
I was trying to reproduce what happened to you. But I was not successful. I cannot imagine how you have lost your file. It could happen only that you saved your file, the upload failed and you have closed the editor without trying to upload the file again. Am I right, or have something else happened?
_________________
Martin Prikryl
obi

Guest


prikryl wrote:
I was trying to reproduce what happened to you. But I was not successful. I cannot imagine how you have lost your file. It could happen only that you saved your file, the upload failed and you have closed the editor without trying to upload the file again. Am I right, or have something else happened?


Completely right !
The upload failed because the server disconnected, but I had no notice that the upload failed. So I hit the reconnect button, close the curent window and reopen the file from the "explorer" window. And the file is empty.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
obi wrote:
Completely right !
The upload failed because the server disconnected, but I had no notice that the upload failed. So I hit the reconnect button, close the curent window and reopen the file from the "explorer" window. And the file is empty.

Thanks for affirmation.
_________________
Martin Prikryl
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