Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::FTP -> ls impossible because large number of files

Status
Not open for further replies.

tonyfluid

Programmer
Jan 25, 2008
2
FR
I use perl Net::FTP to update some data daily. I scan some directories and test if the files are new or not, and download them if yes.
I have a problem in the listing of some directories because there are too many files in, here is the debug output of my program :
Net::FTP: Net::FTP(2.65)
Net::FTP: Exporter(5.567)
Net::FTP: Net::Cmd(2.21)
Net::FTP: IO::Socket::INET(1.26)
Net::FTP: IO::Socket(1.27)
Net::FTP: IO::Handle(1.21)
Net::FTP=GLOB(0x82e87ac)<<< 220 ######.cls.fr FTP server ready.
Net::FTP=GLOB(0x82e87ac)>>> user ####
Net::FTP=GLOB(0x82e87ac)<<< 331 Password required for aviso.
Net::FTP=GLOB(0x82e87ac)>>> PASS ....
Net::FTP=GLOB(0x82e87ac)<<< 230 User #### logged in.
Net::FTP=GLOB(0x82e87ac)>>> CWD ##################
Net::FTP=GLOB(0x82e87ac)<<< 250 CWD command successful.
Net::FTP=GLOB(0x82e87ac)>>> PASV
Net::FTP=GLOB(0x82e87ac)<<< 227 Entering Passive Mode (62,161,32,1,24,201)
Net::FTP=GLOB(0x82e87ac)>>> NLST
Net::FTP=GLOB(0x82e87ac)<<< 550 Arguments too long
Net::FTP=GLOB(0x82e87ac)>>> QUIT

Any help would be greatly appreciated.
Tony
 
It's not necessarily a perl problem.
How many files are in the directory?
And does it work when you try with ftp, without any perl code?
 
With the simple command line ftp client, or with ncftp, or connected with ssh it's possible to list the content of the directory, so I don't think this is at the server side. It's only with my perl program.
There are 4191 files, this is not so many !

Here is the lines concerned :
$ftp = Net::FTP->new($serveurFtp, Debug => 1, Passive =>1, Timeout => 300);
$ftp->login($userFtp, $pwdFtp)
|| &stopFtp("Impossible to connect $serveurFtp");
$ftp->cwd("$dir") || &reconnectFtp($dir);
@listFtpCourant = $ftp->ls(".") or &printLog("WARNING : impossible to list the content of ftp directory");

Thanks,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top