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

Re: wput a symlink? -- depends on the protocol ...



NZG <ngustavson@emacinc.com> wrote:
> Does anyone know how to remotely create a symlink from the
> command line without ssh?

Yes.  But I think you're looking at the problem in a way that
is not applicable.

To start, the concept of a Remote Shell (rsh), including its
replacement Secure Shell (ssh), allows you to remotely
execute commands.  This includes the "ln -s" command.  The
rsh/ssh commands are little more than piped streams -- i.e.,
send characters from one system to another as if run on the
second system.

But what is a symlink?  Symlinks are merely UNIX filesystem
inodes with meta-data.  So could we not transfer a symlink
like any file?  It depends.

If the protocol, be it a character stream or file transfer
protocol, supports direct transfer of POSIX inode meta-data
files, then symlinks can be copied.  Unfortunately, most
protocols do _not_.  So what happens is the symlink is
"dereferenced" and the file it points to is copied. 
Especially file transfer protocols.

Now the archive protocols in UNIX, cpio/tar/pax, which _are_
streaming protocols _can_ store symlinks.  So you could
possibly make a cpio, tar or pax archive, use a file transfer
to put it on another system.  When unarchived, the symlink
will be created.

Another option is the Network Filesystem (NFS), which
actually represents a remote network mount as a local
inode-like filesystem -- symlinks and all!  So that is yet
another option.

> Is there a way to transfer a symlink like a file with wput?

Yes and no.
Wput basically supports FTP and HTTP, so you have to focus on
the limitations of those protocols.

Although IETF RFC959 FTP does not directly support symlinks,
it allows for SITE extensions and SITE SYMLINK is a commonly
understood command for creating symlinks.  Unfortunately,
most simple FTP clients and servers do not support it
(although ProFTPD seems to).

IETF RFC1945 HTTP is just a stream protocol, so if the HTTP
server understand some command to copy/create a symlink, it
will work.  But is there a standard to this?  No, other than
vendor-specific standards, not even WebDAV.

IETF RFC2518 is Web Authoring Extensions for HTTP aka
"WebDAV" (i.e., file management for HTTP).  Unfortunately,
RFC2518 does not seem to support symlinks at all, nor do the
IETF RFC3253 DeltaV (version control) extensions for WebDAV
either.

So what _usually_ happens?  Most FTP and HTTP clients will
dereference the file the symlink points to, and transfer that
file instead.  Hence the problem.  I haven't looked at what
FTP clients support the "SITE SYMLINK" command, but I'm sure
some do.


-- 
Bryan J. Smith                | Sent from Yahoo Mail
mailto:b.j.smith@ieee.org     |  (please excuse any
http://thebs413.blogspot.com/ |   missing headers)

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.