This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
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
Generally, they are either
FileSystemFileEntry objects, which represent standard files, or
FileSystemDirectoryEntry objects, which represent directories.
readEntries(successCallback); readEntries(successCallback, errorCallback);
- 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 either
FileSystemFileEntryobjects, which represent standard files, or
FileSystemDirectoryEntryobjects, which represent directories. If there are no files left, or you've already called
FileSystemDirectoryReader, the array is empty.
- A callback function which is called if an error occurs while reading from the
directory. It receives one input parameter: a
FileErrorobject describing the error which occurred.
DataTransferItem.webkitGetAsEntry() for example code that uses this method.
|File and Directory Entries API |
This API has no official W3C or WHATWG specification.
BCD tables only load in the browser
On Chrome 77,
readEntries() will only return the first 100
FileSystemEntry instances. In order to obtain all of the
readEntries() must be called multiple times.