question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

directoryOpen gives up on large directories

See original GitHub issue

This seems absurd but I have a use case for the Filesystem Access API where I pass it a game folder and it reads all the whole folder recursively for all the files needed to load a map into a webGL instance.

The problem is the folder is ~2.5GB and has ~17,000 files. 2/10 times I open the folder directoryOpen will return an array with all ~17,000 files, the rest of the time the function seems to parse all the folders but stops and doesn’t return anything. This works 100% of the time on Firefox and Safari but in Chrome, latest stable and beta it rarely works.

No errors or warnings in the console, it just stops and doesn’t return at all. Sometimes it will read all the folders successfully but not return at all, sometimes it will stop a few folders short of the total amount of folders. This also happens from time to time with ~2000 files but not as often.

Is this something to do with too many promises being made at once or is this a deeper issue or some maximum limit in the API spec?

Another observation is that introducing an artificial delay with something like

const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)) delay(100)

Increases the chance of the function returning anything by a lot, obviously this takes far longer to load the files. Any ideas? Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tomayaccommented, Feb 9, 2021

Thanks for the bug report. I have routed it to the correct team and close this bug in favor of the Chrome bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Find Out Top Directories and Files (Disk Space) in Linux
This brief tutorial describes how to find the largest files and folders in the Linux file system using du (disk usage) and find...
Read more >
How To Back Up Large Directories with Unison On Ubuntu ...
First, create the directory that will hold the data to back up by running the following command from the primary_user home directory: mkdir...
Read more >
Linux: ncdu and mc to manage large directories
' It provides a fast way to view and manage directories using disk space. Users can navigate using the arrow keys and delete...
Read more >
open() gives FileNotFoundError/IOError: Errno 2 No such file ...
Call os.chdir(dir) , dir being the folder where the file is located, then open the file with just its name like you were...
Read more >
Reading and writing files and directories with the browser-fs ...
All modern browsers can read local files and directories; however, true write access, that is, more than just downloading files, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found