I just realized that one my favorite tools is something I've never written about here. If you're an Emacs user, there's a chance you're familiar with ange-ftp. It's an Emacs Lisp module that lets your browse remote FTP directories as if they were local filesystems. You can open, edit, save, and so on--never caring that the files are half way around the world.

In a world where I use secure methods (ssh, scp, and rsync over ssh) for remotely manipulating my files, ange-ftp isn't terribly useful anymore.

Tramp is the modern version of ange-ftp. It groks the tools I use. To quote the web site:

TRAMP stands for `Transparent Remote (file) Access, Multiple Protocol'. This package provides remote file editing, similar to Ange-FTP. The difference is that Ange-FTP uses FTP to transfer files between the local and the remote host, whereas TRAMP uses a combination of rsh and rcp or other work-alike programs, such as ssh/scp.

It's slick, seamless integration. In my ~/.emacs file I have:

(require 'tramp)
(setq tramp-default-method "scp")

And then if I want to open a file remotely, I simple ask emacs to open:

/myserver:public_html/foo.html

Or, to fully qualify things and illustrate the syntax a bit more, I can use:

/jeremy.zawodny.com:/home/jzawodn/public_html/foo.html

And emacs does what I expect in either case. Tramp handles all the details behind the scenes. It's really quite handy.

Posted by jzawodn at September 27, 2003 05:43 PM

Reader Comments
# Matthew Freeman said:

Rock! I just got it working and it beats the heck out of endlessly scp-ing files back and forth. Yet another reason for me to make the switch to emacs. :-)

on October 7, 2003 05:41 PM
# Rich said:

If you're using KDE, Konqueror (the file browser) will transparently handle modifying remote files over FTP and SSH (and, I'm sure, many others). This sort of thing is better handled by the OS/filesystem/filebrowser than on a per application basis.

on October 4, 2004 04:10 AM
# Daniel said:

I agree that this is very useful. I'll be using it a lot from now on. I've been running emacs as a remote X application on a wireless network, and this is much better.

I'm curious (but not that curious) about Rick's comment about the KDE filebrowser. How does that work? (i.e. how do you trick an application into opening a remote file?) Does it copy things to a temporary file and open that, and copy back to the server when the file is saved? How does KDE know that emacs is done with the file?

Not that I disagree with the general principle- but I would think you need something like sshfs to do this. I don't think it can be done in a satisfing manner just from the filebrowser.

on September 22, 2005 11:42 PM
# Neil said:

Hi.
Rich's comment is what I tend to follow. I have emacs (xemacs) set up as the default editor for all my web files etc. and open them by double-clicking on them through Konqueror.
If you set your sftp sites up as bookmarks, then things become a lot more convenient.

I personally use Linux, Mac OSX and Windows on a daily basis so I am constantly looking at ways of simplifying things and making procedures more 'standard' to reduce my confusion levels :-)

It's all good fun y'know!

Neil.

on July 7, 2006 07:16 AM
# Kasper said:

I guess the comment about KDE is about native KDE applications. All native KDE applications access files through a library, which implement such features. It doesn't mean that KDE magically add such features to emacs. So it just means that whatever KDE editor happens to provide, it will support accessing files over ssh and other protocols. (I guess there has been implemented more than one editor for KDE, and if my guess is correct, all of them would support this feature).

BTW there has been work on making the backends in KDE and fuse interchangable. Personally I like the KDE approach better than fuse. I think the way fuse mixes user code and kernel code is a bad design.

on March 28, 2007 12:29 PM
# muhabbet said:

it is working

on February 21, 2008 04:49 AM
# Jim said:

Jeremy, do you know of a way to do ediff-directories, comparing local files with those on a remote machine using TRAMP?

When I run this, it does work, but the top level Group Panel of ediff doesn't run the "==" command (show which files are identical). I have to go into each file pair individually to see if they are different. It would be really awesome if there were a workaround for this!

Thanks!
/Jim

on February 26, 2008 08:43 AM
# Will said:

When I try this, I got "Process *tramp/scp dav* exited abnormally with code 255" error.

Any idea to fix that? Thanks.

on April 20, 2010 07:51 PM
Disclaimer: The opinions expressed here are mine and mine alone. My current, past, or previous employers are not responsible for what I write here, the comments left by others, or the photos I may share. If you have questions, please contact me. Also, I am not a journalist or reporter. Don't "pitch" me.

 

Privacy: I do not share or publish the email addresses or IP addresses of anyone posting a comment here without consent. However, I do reserve the right to remove comments that are spammy, off-topic, or otherwise unsuitable based on my comment policy. In a few cases, I may leave spammy comments but remove any URLs they contain.