1

I have 27425 files on FTP server. When I use ftp.nlst() get filename list, it always get 10000 results. How can I get more than 10000 results?

from ftplib import FTP
import os, sys, os.path
ftp = FTP('host', 'username', 'passwd')
ftp.cwd('/browse')

filelist = ftp.nlst() 

print filelist

ftp.quit()

thanks a lot.

Furry Bear
  • 27
  • 4

1 Answers1

0

It is probably not a client issue (your python program) but the server just cuts down the result set. See here for a similar problem.
Essentially you will most likely have to adjust some settings of your FTP server's configuration. If you don't have access to that then you may need to distribute your files to multiple directories.

Community
  • 1
  • 1
DAXaholic
  • 33,312
  • 6
  • 76
  • 74
  • Thank you for reply. Because I am not FTP server owner, so I can't try this way. I'll ask the owner to try. Thank you very much. :) – Furry Bear Jun 29 '16 at 07:30