zsh-users
 help / color / mirror / code / Atom feed
* how can I make a local directory be a symlink to a remote one?
@ 2002-09-27  9:54 Eric De Mund
  2002-09-27 11:03 ` Borzenkov Andrey
  0 siblings, 1 reply; 3+ messages in thread
From: Eric De Mund @ 2002-09-27  9:54 UTC (permalink / raw)
  To: zsh-users

Folks,

How can I make a local directory be a virtual symbolic link to a remote
directory? (Where "remote" means accessible via ssh(1) and friends.)

For example, I'd like file copies (cp(1)'s) to and from my local ~/foo
directory to actually be scp(1)'s to and from my remote ~/foo directory,
and ls(1)'s of my local ~/foo directory to actually be ssh(1)-invoked
ls(1)'s of my remote ~/foo directory. In the first case, I could
implement this with a script that, say, checked for commands of the form
"cp file ... ~/foo", rewriting them as "scp file ... rhost:~/foo", but
that seems inelegant.

Can anyone point me to a Zsh idiom or meme that would permit me to do
this? Or is this better implemented in some non-Zsh way?

On a more general note, does Zsh support or has anyone fashioned Zsh
functions so that particular commands have directory-specific meanings?

I've been using the shell since 1990, yet I confess I'm only using a
fraction of its capabilities.

Regards,
Eric
--
"Tracks exist at the interface where the sky drags along the surface of the
earth." --Tom Brown, Jr.

Eric De Mund <ead@ixian.com> | Ixian Systems, Inc. | 53 49 B2 23 AF 6C 20 81
http://www.ixian.com/ead/    | Mountain View, CA   | ED DD 4C 81 AA C9 D1 A5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: how can I make a local directory be a symlink to a remote one?
  2002-09-27  9:54 how can I make a local directory be a symlink to a remote one? Eric De Mund
@ 2002-09-27 11:03 ` Borzenkov Andrey
  2002-09-27 17:02   ` Wayne Davison
  0 siblings, 1 reply; 3+ messages in thread
From: Borzenkov Andrey @ 2002-09-27 11:03 UTC (permalink / raw)
  To: 'Eric De Mund', zsh-users


> 
> How can I make a local directory be a virtual symbolic link to a
remote
> directory? (Where "remote" means accessible via ssh(1) and friends.)
> 
> For example, I'd like file copies (cp(1)'s) to and from my local ~/foo
> directory to actually be scp(1)'s to and from my remote ~/foo
directory,
> and ls(1)'s of my local ~/foo directory to actually be ssh(1)-invoked
> ls(1)'s of my remote ~/foo directory. In the first case, I could
> implement this with a script that, say, checked for commands of the
form
> "cp file ... ~/foo", rewriting them as "scp file ... rhost:~/foo", but
> that seems inelegant.
> 
> Can anyone point me to a Zsh idiom or meme that would permit me to do
> this? Or is this better implemented in some non-Zsh way?
> 

I do not see anything inelegant in zsh functions, but ...

It is of course possible to write shell functions for ls, cp, mv &
friends that would intercept access to specific directories and call ssh
for them. But you of course understand that it will work only when you
use these commands, more over, only when you use them from inside of
shell. Any other program trying to access these directories will see
just a normal local ones.

To do what you want transparently you need one of

- shared library that will be preloaded and will intercept syscalls for
open, creat, stat, etc in specific directories (you may check SAMBA for
example implementation, they do exactly the same for SMB access). This
solution unfortunately is not truly portable because not every system
supports library preloading, besides it does not work for statically
linked programs.

- implement new file system in kernel.


-andrey


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: how can I make a local directory be a symlink to a remote one?
  2002-09-27 11:03 ` Borzenkov Andrey
@ 2002-09-27 17:02   ` Wayne Davison
  0 siblings, 0 replies; 3+ messages in thread
From: Wayne Davison @ 2002-09-27 17:02 UTC (permalink / raw)
  To: zsh-users

> How can I make a local directory be a virtual symbolic link to a remote
> directory? (Where "remote" means accessible via ssh(1) and friends.)

You might want to check into something like SFS:

    http://www.fs.net/

The Self-certifying File System lets users securely share resources
between systems.  It's not yet release-quality code, but several
developers have been using it without lost data for several years now.
I haven't tried it yet, but it looks very interesting to me.

..wayne..


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-27 17:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-27  9:54 how can I make a local directory be a symlink to a remote one? Eric De Mund
2002-09-27 11:03 ` Borzenkov Andrey
2002-09-27 17:02   ` Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).