Showing results for 
Search instead for 
Did you mean: 

FTP transfer error?


FTP transfer error?

Hi all

I made a tranfer of file from one system to another, no error was reported.
A few days after I realized the version of the file was the older one, so the transfer was not successeful.
I also found this error:

A copy of an editor buffer of your file "xpto"
was saved when the system went down.
This buffer can be retrieved using the "recover" command of the editor.
An easy way to do this is to give the command "ex -r xpto".
This works for "edit" and "vi" also.

I ran the command and it worked, the new version appeared.
I just want to understand what happened...

Any clarification would be nice.
Thank you in advance.

System administrator
Eugen Cocalea
Respected Contributor

Re: FTP transfer error?


The ftp was ok and you got the file right. But somehow, maybe you tried to edit it then the machine or shell crashed and the editor saved the file currently edited (ie new version) when he recieved the 'hang up' signal. Then you recovered it (the new version) using ex -r.

I think. :)

To Live Is To Learn
Stefan Farrelly
Honored Contributor

Re: FTP transfer error?

The original ftp transfer didnt work because either the system crashed while you have a vi session running or your shell with the vi session running was killed (by someone or the system going down - either crashing or someone rebooting it).
Im from Palmerston North, New Zealand, but somehow ended up in London...
Frank Slootweg
Honored Contributor

Re: FTP transfer error?

To build on Eugen's and Stefan's responses:

It looks like, whether you realized this or not, when you did the FTP, the editor was still running and the modified file had not yet been written to disk. Hence the FTP command found the old file content and copied that.

Note that "the editor" (probably vi) does not write the modified file to the named file unless/until you explicitly or implicitly say so. During the edit session, everything is kept in temporary files. When the editor 'crashes', the temporary files are kept and the expreserve command (in /sbin/init.d/clean_ex) performs the recovery actions you encountered (see "crash" and "preserve" in the ex(1) manual page).