Local copies of edited files ?

Advertisement

obi
Guest

Local copies of edited files ?

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 :?

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: Local copies of edited files ?

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.

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.

3:Have an option to keep local copies of edited files a certain amount of time
Same as point 1.
_________________
Martin Prikryl

Reply with quote

obi
Guest

Re: Local copies of edited files ?

martin 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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: Local copies of edited files ?

OK, I'll try to do something with this :-)
_________________
Martin Prikryl

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: Local copies of edited files ?

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

Reply with quote

obi
Guest

Re: Local copies of edited files ?

martin 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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: Local copies of edited files ?

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

Reply with quote

Advertisement

You can post new topics in this forum