Directory listing query with Net::FTP::list 
Author Message
 Directory listing query with Net::FTP::list

I have been trying to capture a directory listing from an FTP server using
the "list" method (part of Net::FTP).

I can't figure out how to put the list into an array or hash, and cannot
reference the type glob it returns.

Been looking for an example on the web, but can't find one.

Any help would be appreciated.

thanks

Miles.



Wed, 18 Jun 1902 08:00:00 GMT  
 Directory listing query with Net::FTP::list

Quote:
> I have been trying to capture a directory listing from an FTP server using
> the "list" method (part of Net::FTP).

You should really be using the ls() method.

Quote:
> I can't figure out how to put the list into an array or hash, and cannot
> reference the type glob it returns.

> Been looking for an example on the web, but can't find one.

Looking in the wrong place. Try "perldoc Net::FTP" instead.

Here is some code that worked for me:

====
use Net::FTP;


exit unless $passwd;

$ftp = Net::FTP->new($ftpserver);
$ftp->login($user, $passwd);

$ftp->quit;


====

General advice: When using module Cool::Stuff, do "perldoc Cool::Stuff"
first. If the docs is unclear, do "perldoc -m Cool::Stuff" to read the
source. Still don't understand? Then go deja.com to look for "Cool::Stuff"
in "comp.lang.perl.*". If all else fails and your boss is threatening you,
post to comp.lang.perl.misc/modules. Finally, pray very hard. :)

Swee Heng



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Directory listing query with Net::FTP::list

2. net::ftp directory listing???

3. Parsing FTP Directory listing

4. FTP Recursive Directory Listing

5. FTP Recursive Directory Listing

6. ftp Directory Listing

7. Net::FTP get one file only ?/ from list/

8. ERROR WITH NET::FTP, FILE::LISTING

9. Net::FTP remote dir listing help

10. Net::FTP, Mime::Lite and receivers list

11. (undef || LIST) vs (LIST || LIST)

12. (undef || LIST) vs (LIST || LIST)

 

 
Powered by phpBB® Forum Software