The readEntries
method of FileSystemDirectoryReader
was incorrectly used in a synchronous manner instead of asynchronously.
#33342
Labels
area: File/File System
Content:WebAPI
Web API docs
goal: accuracy
(Experimental label) Issues about inaccurate/incorrect content.
help wanted
If you know something about this topic, we would love your help!
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader
What specific section or headline is this issue about?
Examples
What information was incorrect, unhelpful, or incomplete?
entries
always remains an empty array ([]), because by the timereadDirectory
function completes, the callback ofreadEntries
hasn't executed yet, leavingentries
unaltered.toArray()
function is not defined here.getEntries()
fails to retrieve subfolders, preventing further traversal and acquisition of all files within directories. It also potentially leads to an infinite loop.What did you expect to see?
Given a
FileSystemDirectoryEntry
, obtain all files within the directory (including subdirectories) represented by this object.Below is my attempted modification using promises.
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/api/filesystemdirectoryentry/createreader
The text was updated successfully, but these errors were encountered: