title: Ways to define start point when scanning a directory for filenames in php over ftp
body: <p>As far as I can tell, this isn't possible, but I want to make sure.</p>
  
  <p>I am moving files from one IP to another on the same hosting site since they will not do it for me. Here is a snippet from my script.</p>
  
  <pre><code>...
  $files = ftp_nlist($remoteconn, '.');
  foreach ($files as $file) {
      if ($file != '.' &amp;&amp; $file != '..') {
          recurse($remoteconn, $remoteserver, $remoteuser, $remotepass, $directorypath . '/' . $file);
      }
  }
  ...
  </code></pre>
  
  <p><code>recurse()</code> is a function that closes any open connection, opens a new one, checks if the file is a directory or data file, and either creates the directory locally or copies over the data file to the local directory.</p>
  
  <p>The problem I have run into is that my host has limited the FTP file listing to 500 entries so I only get 498 usable entries in my <code>$files</code> array. I have several directories with over 2k files in them because this is a fan site Coppermine gallery and therefore, every image has 2 or more entries (up to 4) depending on its dimensions.</p>
  
  <p>The host has refused to increase the number of entries returned. I've attempted to work around this by opening the index listing to view the files and by zipping the directory, but I still only get 498 files in each case.</p>
  
  <p>The only solution I can think of is to figure out the files names, which in some cases are not intuitive or sequential (thank you, Facebook,) and setup a script to grab each file by its name instead of grabbing a list of the directory contents.</p>
  
  <p>However, I wanted to make a last ditch effort/plea for another solution because the above would be very time consuming and if there was a way to look at a directory by defining where I want to start pulling from, I would be ecstatic.</p>
  
  <p>If the solution requires a language other than php, I am still all ears.</p>
  
  <p><strong>ETA:</strong> I always wanted to mention that both <code>ftp_nlist</code> and <code>ftp_rawlist</code> only return 498 usable entries, and that FXP is disabled and they are not willing to enable it.</p>