If I do $ftp->get(/path/to/file) it gets it. But cwd'ing to the directory, and doing ls, returns a null list.

I think this has nothing to do with Net::FTP or any sort of mget or ls function. It has to do with how permissions are set on the particular directory on the ftp server.

There's a little trick that the ftp maintainer can play with directory permissions, to provide a certain amount of "access control" or "data security" for files in the given directory. On a unix system, you can do this to a directory:

chmod 751 some_directory
which causes it to have permission (mode) flags like this: "rwxr-x--x", which means:

So, this sort of permission allows the ftp server to provide some data protection -- that is, to limit distribution to specific recipients -- because only the owner can put files in, and the only people that can get files are those in the owner's group, or else people who have been told exactly what file names to retrieve.

This is also commonly used on ftp "upload" directories, where anon.ftp users can "put" files -- here the permission would be "rwxrwx-wx": anybody can create files in the directory, but only owner and group can search for file names. If one anon.ftp user puts a file into such a directory, other anon.ftp users won't know it's there, unless they are told what the file name is by someone who knows.

(updated to fix grammar)


In reply to Re^3: "Net::FTP" missing "mget" by graff
in thread "Net::FTP" missing "mget" by GaijinPunch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.