symlinks

$

$_

am i correct in thinking that some ftp site only stor a link to another site
which actually hosts the data? if so how should a ftp client handle this?
i mean should i make it so that when the remote remote file is clicked it
follows this 'symlink' or whatever its called to the second or third or fourth
ftp server? hmm this may be getting away from perl talk.... sorry but its a
perl program in the end, id really like to post the code here if anyone is willing
to have a look.
 
$

$_

Just a quick follow up, i wanted to mention that i have tried
using Net::FTP::Recursive and i really like the way it follows
these 'symlinks' only thing i dont like the recursive bit...
its too slow... i only want the part where it follows the links
but i cant figure the module out 0_o
im not quite good enough to understand well written modules
only well not so well written ones heh.
 
G

gnari

am i correct in thinking that some ftp site only stor a link to another site
which actually hosts the data? if so how should a ftp client handle this?
i mean should i make it so that when the remote remote file is clicked it
follows this 'symlink' or whatever its called to the second or third or fourth
ftp server? hmm this may be getting away from perl talk.... sorry but its a
perl program in the end, id really like to post the code here if anyone is willing
to have a look.

no

gnari
 
$

$_

Just a quick follow up, i wanted to mention that i have tried
using Net::FTP::Recursive and i really like the way it follows
these 'symlinks' only thing i dont like the recursive bit...
its too slow... i only want the part where it follows the links
but i cant figure the module out 0_o
im not quite good enough to understand well written modules
only well not so well written ones heh.
sigh, no suggestions? I'm just ignoring them atm...
if ($perms =~ m/^l+?/) {goto populate_end;} #ignore symlinks :-(
 
S

Sherm Pendley

am i correct in thinking that some ftp site only stor a link to another site
which actually hosts the data?

Possibly, if it's serving up a shared file system, such as one on an NFS
or SMB/CIFS file server.
if so how should a ftp client handle this?

In the above situation, I don't think the client would get to handle it -
details such as mount points are, afaik, hidden from the client.
i mean should i make it so that when the remote remote file is clicked it
follows this 'symlink' or whatever its called to the second or third or fourth
ftp server?

Symlinks (short for symbolic links) are an entirely different beast.
They're like an "alias" or "shortcut," to use two terms from popular
desktop OSes. They're not actual sub-directories or files, just references
to something else. That "something else" might be on a file system mounted
from a remote machine, or local; there's no way to tell based on the
symlink alone, which contains only a path name.

Most FTP servers list symlinks in a way that makes it impossible to know
whether it points to a directory or to a file. That's why recursive
operations are slower for symlinks. The client doesn't know what sort of
"think" it points to. So, when it encounters a symlink, the client has to
first try to "cd linkname", and if that fails, attempt to fetch it as a
file instead. (Or vice-versa; most clients let the user configure which
should be tried first.)

This is all pretty basic stuff, and nothing at all to do with Perl. I'd
suggest a decent book about UNIX usage for more about symlinks, and RFC
959 for the last word on the FTP protocol.

sherm--
 
$

$_

sherm-- Wrote:
The client doesn't know what sort of
"think" it points to. So, when it encounters a symlink, the client has to
first try to "cd linkname", and if that fails, attempt to fetch it as a
file instead. (Or vice-versa; most clients let the user configure which
should be tried first.)
Nod, thanks alot... yea ive implemented into my Peal application that
very function. Although im not sure how to handle the off-site items
that some ftp sites have (ftp.mozilla.org) for example.
I suppose ill just have to create a new Net::FTP object for each of those
sort of off-site links.

Thanks again for the help and the background nix nfo.
 
S

Sherm Pendley

Although im not sure how to handle the off-site items
that some ftp sites have (ftp.mozilla.org) for example.

I took a look at ftp.mozilla.org - do you mean the items in the
/pub/mirrors directory?

If so, then there's nothing to worry about - those aren't references to
other sites, they're just ordinary directories that contain a copy of all
the stuff from another site. They have names like "ftp.whatever.org", but
that doesn't mean anything special, it's just a directory name, not a
pointer or reference to another server.

The actual "mirroring" is done by another program - rsync or similar -
that periodically checks the target site, copying anything that's changed
to the local server. It's not something that your FTP client will need to
worry about.

sherm--
 
$

$_

I took a look at ftp.mozilla.org - do you mean the items in the
/pub/mirrors directory?
Nod.

The actual "mirroring" is done by another program - rsync or similar -
that periodically checks the target site, copying anything that's changed
to the local server. It's not something that your FTP client will need to
worry about.

sherm--

Phew... that sure is a relief, well it has been a pleasure listening to you.
Thank you very much for all the usefull input.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,145
Messages
2,570,824
Members
47,371
Latest member
Brkaa

Latest Threads

Top