title: File and Directory Entries API broken in Chrome?
body: <p>I'm trying to use the File and Directory Entries API to create a file uploader tool that will allow me to drop an arbitrary combination of files and directories into a browser window, to be read and uploaded.</p>
  
  <p>(I'm fully aware that similar functionality can be achieved by using an file input element with <code>webkitdirectory</code> enabled, but I'm testing a use case where the user isn't forced to put everything into a single folder)</p>
  
  <p>Using the Drag and Drop API, I've managed to read the <code>DataTransfer</code> items and convert them to <code>FileSystemEntry</code> objects using <code>DataTransferItem.webkitGetAsEntry</code>.</p>
  
  <p>From there, I am able to tell that if the entry is a <code>FileSystemFileEntry</code> or a <code>FileSystemDirectoryEntry</code>. My plan of course if to recursively walk the directory structure, if any, which I should be able to do using the <code>FileSystemDirectoryReader</code> method <code>readEntries</code>, like this:</p>
  
  <pre><code>handleDrop(event) {
      event.preventDefault();
      event.stopPropagation();
      //assuming I dropped only one directory
      const directory = event.dataTransfer.items[0];
      const directoryEntry = directory.webkitGetAsEntry();
      const directoryReader = directoryEntry.createReader();
      directoryReader.readEntries(function(entires){
          // callback: the "entries" param is an Array 
          // containing the directory entries
      });
  }
  </code></pre>
  
  <p>However, I'm running into the following issue: in Chrome, the readEntries method <strong>only returns 100 entries</strong>. Apparently, this is the expected behavior as the way to obtain subsequent files from the directory is to call <code>readEntries</code> again. However, I'm finding this impossible to do. A subsequent call to the method throws the error: </p>
  
  <p><code>DOMException: An operation that depends on state cached in an interface object was made but the state had changed since it was read from disk.</code></p>
  
  <p>Does anyone know a way around this? Is this API hopelessly broken for directories of 100+ files in Chrome? Is this API deprecated? (not that it was ever "precated"). In Firefox, <code>readEntries</code> returns the whole directory content at once, which apparently against the spec, but it is usable.</p>
  
  <p>Please advice.</p>