help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TRAMP corrupting files


From: Anselm Helbig
Subject: Re: TRAMP corrupting files
Date: Fri, 08 May 2009 10:21:46 +0200
User-agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

Hi!

> I'm using Tramp from my Mac to edit remote files. Twice in the last
> few days I've experienced Tramp corrupting my files.
> 
> The first corruption happened mid way through a PHP file, looking like this:
> 
> ...
>  <option value="C"<?=$uresult['store_cluster']=="C"?"
> selected":""?>>Cluster C</option>
>                         <opv˷⌀ “䛆需戀܀㜀䜀阀
> 
> I think the characters might have been encoded above. What I see in
> emacs is this
> 
> ...
>  <option value="C"<?=$uresult['store_cluster']=="C"?"
> selected":""?>>Cluster C</option>
>                         <opv\367^B#\340\240\220\223\306...
> 
> This corruption goes on for 35,202 characters (all on one line) then
> the file ends.
> 
> 
> The second time I had a file get corrupted, interestingly also in a
> PHP file inside of a <select> option group, There were not funky
> characters, just a few dozen lines of missing from my file.
> 
> It's really starting to scare me as I'm not sure I can trust this
> method of remote file editing... My hosting company was able to assist
> me once in recovering a backup... I'd have for this to happen again..
> 
> Is TRAMP known to do this sort of thing?
> 
> Are there Emacs alternatives to remote file editing (w/o corruption)?
> 
> Thanks.
> 
> Carbon Emacs  "22.2.1"
> Tramp "2.0.57"

I didn't have these kinds of problem. But TRAMP can definitely be
fragile under some circumstances - it's a complex thing to handle all
possible remote hosts, terminal settings and connection methods. 

There's a lot of configuration options for TRAMP you could try, i.e.
use the scp/sftp external transfer methods. This slows things down a
bit unless you're using OpenSSHs ControlMaster feature. 

Another option might be the experimental "fish" connection method. 

TRAMP relies on the mimencode and uuencode/uudecode commands on the
remote host for transferring your files. What remote host are you
connecting to? What OS does it run? Is mimencode present? Can you have
it installed on the remote host? Maybe this will solve your problem. 

For alternatives to TRAMP, see

  http://www.emacswiki.org/emacs/CategoryRemoteEmacs

You could also mount the remote directory via fuse with sshfs on
Linux. For the Mac there's macfuse:

  http://code.google.com/p/macfuse/

You're losing a bit of emacs integration here: i.e. if you're using
eshell and cd to a remote TRAMP directory, all commands that you issue
are executed are really sent to the remote host. This can not work
anymore with fuse. Also there's integration with version control and
TRAMP.

You could also change your workflow completely, set up version control
and a development system on your local computer and push changes to
the remote host in a more controlled fashion. 

HTH,

Anselm


-- 
Anselm Helbig 
mailto:anselm.helbig+news2009@googlemail.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]