What are you asking for? An LS listing of files on the ftp server?

If that is the case you will find that it depends. The mod is not complete(you will see mget is missing) and some FTP clients don't have all the commands

Here is a snippet of old code I threw together when building an autodownloader for virus DAT files. I needed an LS of the directory since mget did not work and there were multple files to choose from:

sub ftp_sdat { my $path = "pub/antivirus/datfiles/4.x/"; use constant HOST => 'ftp.nai.com'; use constant DIR => 'pub\antivirus\datfiles\4.x'; my $depost = "D:\\Depot\\McAfee\\updateNT\\"; my $ftp = Net::FTP->new(HOST) or die "Couln't connect: $@\n"; $ftp ->login("anonymous",'user@domain.com') or die $ftp->message; $ftp->binary or die $ftp->message; # # Since the Mget command is missing. We get a ls listing and then # look for the current SDAT file. my @dirlist = $ftp->ls("$path") or die $ftp->message; foreach my $file (@dirlist) { if ($file =~ /sdat/) { print "dat $file\n"; $ftp->get("$file") or die $ftp->message; } } $ftp->quit; return $file; }

If this is not the case, reply back with more details....


In reply to Re: How to fulfil the function of ftpls on windows by Marza
in thread How to fulfil the function of ftpls on windows by Anonymous Monk

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.