Discussion:
Tramp with sshfs
(too old to reply)
Andrea Crotti
2010-08-17 09:42:09 UTC
Permalink
I was wondering it it would be possible to use tramp even if I'm
actually using sshfs.

Unfortunately tramp over ssh is a bit too slow (I also have the
controlmaster activated, anything else I can do?), and sshfs is normally
much nicer.

But when I launch a command I would like to get it executed on the
remote machine where the files really are.

How could I cheat this thing somehow?
Thanks,
Andrea
Michael Albinus
2010-08-17 14:33:49 UTC
Permalink
Post by Andrea Crotti
I was wondering it it would be possible to use tramp even if I'm
actually using sshfs.
Unfortunately tramp over ssh is a bit too slow (I also have the
controlmaster activated, anything else I can do?), and sshfs is normally
much nicer.
For large files, scp might be faster. It depends.
Post by Andrea Crotti
But when I launch a command I would like to get it executed on the
remote machine where the files really are.
How could I cheat this thing somehow?
Not with the existing Tramp packages. One ould introduce a new method
"sshfs", which works similar as in tramp-gvfs.el: mount the sshfs
"filesystem" on a temporary mount point, and map silently file names
like "/sshfs:host:/path/to/file" to "/mount_point/path/to/file".

Processes on the remote host could be handled similar to the handling
for the "ssh" method.

I will add an entry to Tramp's todo list. Unfortunately, I am short in
time, if there is a volunteer ...
Post by Andrea Crotti
Thanks,
Andrea
Best regards, Michael.
Andrea Crotti
2010-08-17 16:47:44 UTC
Permalink
Post by Michael Albinus
For large files, scp might be faster. It depends.
Some experiments shows that is quite the same, at least for what I've
tried...
Post by Michael Albinus
Not with the existing Tramp packages. One ould introduce a new method
"sshfs", which works similar as in tramp-gvfs.el: mount the sshfs
"filesystem" on a temporary mount point, and map silently file names
like "/sshfs:host:/path/to/file" to "/mount_point/path/to/file".
Processes on the remote host could be handled similar to the handling
for the "ssh" method.
I will add an entry to Tramp's todo list. Unfortunately, I am short in
time, if there is a volunteer ...
Ah that's interesting, if you point out where more or less to have a
look it would be nice to try to see if I'm able to.

And also I only found a CVS repository, something distributed would be
better if I want to play with my version.
Is there anything or should I use git-import magic?
Andrea Crotti
2010-08-17 16:58:30 UTC
Permalink
Post by Andrea Crotti
Ah that's interesting, if you point out where more or less to have a
look it would be nice to try to see if I'm able to.
And also I only found a CVS repository, something distributed would be
better if I want to play with my version.
Is there anything or should I use git-import magic?
To make it even more simple, what if we have a list like
'(('/volumes/arch' . 'arch')...)

of (paths . name_in_ssh_config)

What I would want then is that every time I execute a command it's
executed instead of my local machine on the remote machine.


With some hooks or advising the shell-command could not that work or is
too ugly/not working?
Michael Albinus
2010-08-17 19:19:08 UTC
Permalink
Post by Andrea Crotti
Post by Andrea Crotti
Ah that's interesting, if you point out where more or less to have a
look it would be nice to try to see if I'm able to.
There are some packages like this. tramp-smb.el, tramp-gvfs.el,
tramp-imap.el. All of them add new methods to Tramp. You could try to
study them.
Post by Andrea Crotti
Post by Andrea Crotti
And also I only found a CVS repository, something distributed would be
better if I want to play with my version.
Is there anything or should I use git-import magic?
Until now, being the only continously working Tramp maintainer, I was
too lazy to move somewhere else but cvs. It is on the "maybe we shall
change it" list. If needed, we could use a different dvcs, like git or
bzr. It depends on what gnu.org supports.
Post by Andrea Crotti
To make it even more simple, what if we have a list like
'(('/volumes/arch' . 'arch')...)
of (paths . name_in_ssh_config)
What I would want then is that every time I execute a command it's
executed instead of my local machine on the remote machine.
Tramp offers own implementations for so called "magic file name
handlers". The idea is, that in `file-name-handler-alist' for every such
a primitive function it is checked, whether there is a file name
handler, depending on the syntax of the file name in question.

You find there an entry like

("\\`/\\([^[/:]+\\|[^/]+]\\):" . tramp-file-name-handler)

That means, for file names with Tramp's remote file name syntax, the
Tramp implementation for these magic functions is applied.

See (info "(elisp) Magic File Names") for the list of magic functions.
Post by Andrea Crotti
With some hooks or advising the shell-command could not that work or is
too ugly/not working?
One could add another entry to `file-name-handler-alist', like

(cons (reqexp-quote "/volumes/arch") 'sshfs-file-name-handler)

`sshfs-file-name-handler' would add implementations at least for
`file-remote-p', `process-file', `shell-command', `start-file-process'.
Maybe also for other functions, don't know.

This could be part of Tramp, or a package on its own.

Best regards, Michael.

Loading...