web api instance method
FileSystemDirectoryReader: readEntries() method
The FileSystemDirectoryReader interface’s readEntries() method retrieves the directory entries
within the directory being read and delivers them in an array to a provided callback function.
The objects in the array are all based upon FileSystemEntry.
Generally, they are either FileSystemFileEntry objects, which represent standard files, or FileSystemDirectoryEntry objects, which represent directories.
Syntax
readEntries(successCallback)
readEntries(successCallback, errorCallback)
Parameters
successCallback- : A function which is called when the directory’s contents have been retrieved. The
function receives a single input parameter: an array of file system entry objects,
each based on
FileSystemEntry. Generally, they are eitherFileSystemFileEntryobjects, which represent standard files, orFileSystemDirectoryEntryobjects, which represent directories. If there are no files left, or you’ve already calledreadEntries()on thisFileSystemDirectoryReader, the array is empty.
- : A function which is called when the directory’s contents have been retrieved. The
function receives a single input parameter: an array of file system entry objects,
each based on
errorCallbackOptional- : A callback function which is called if an error occurs while reading from the
directory. It receives one input parameter: a
DOMExceptionobject describing the error which occurred.
- : A callback function which is called if an error occurs while reading from the
directory. It receives one input parameter: a
Return value
None (undefined).
Examples
See DataTransferItem.webkitGetAsEntry() for example code that uses this method.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
In Chromium-based browsers, readEntries() will only return the first 100 FileSystemEntry instances. In order to obtain all of the
instances, readEntries() must be called multiple times.