Menu

listChildren limitation?

Help
Joe Smith
2003-09-03
2003-09-04
  • Joe Smith

    Joe Smith - 2003-09-03

    Hi,

    the following piece of code:

    ArrayList list = new ArrayList();
    int result = sftp.listChildren(locdir, list);
    log.debug("Directory contents retrieved."+result+" elements ("+list.size()+")");

    will give me only the first 100 results in my directory.
    I'm using the OpenSSH server, and doing a "ls" from a console client (Putty), gives me the correct list (more than 1000 entries).
    Is this a known issue? Is there any configuration parameter to handle this? Is this a bug? I'm a bit lost.

    Thanks!!

     
    • Lee David Painter

      Your using the method incorrectly.

      You should call listChildren multiple times untill it returns -1 to indicate that no more files are available to be listed.

      Have you tried using the SftpClient instead? Its a much more simpler interface and would only require one call to ls.

       

Log in to post a comment.