Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use case for move() from OPFS ↔ user-visible file system #114

Open
tomayac opened this issue Apr 20, 2023 · 2 comments
Open

Use case for move() from OPFS ↔ user-visible file system #114

tomayac opened this issue Apr 20, 2023 · 2 comments

Comments

@tomayac
Copy link
Contributor

tomayac commented Apr 20, 2023

In Moving Non-OPFS Files, @a-sully asks for use cases for compelling moving files in-between file systems. One such use case could be moving large files (example), where the user doesn't have enough free disk space to allow for a copy.

@jed
Copy link

jed commented May 11, 2023

Another example is to defer permission requests until needed. For example, an IDE that:

  1. pre-populates the OPFS with a folder containing project scaffolding (src, lib, package.json, et al),
  2. lets me view and edit those files/directories, and then
  3. lets me move them to my local drive once i'm ready to grant write permissions.

@Jaifroid
Copy link

Jaifroid commented Jul 9, 2023

I also need to be able to move, rather than copy, files from visible to OPFS and vice versa. Ideally this would work on Android, though I think lack of the showOpenFilePicker and showDirectoryPicker methods on Android could be a blocker.

I have a PWA -- offline Wikipedia (Kiwix) -- that deals with often very large archives (2GB would be standard, but archives can be up to 97GB). While I don't expect to be able to move a 97GB file into OPFS (though it would be a dream come true if I could in a relatively performant manner), being able to move 2GB archives in and out without the overhead of copying and doubling disk-space requirements would enable our users to download these large archives outside of the app, transfer them in and then access them seamlessly (without permission prompts) and with greater performance than when accessing files from visible storage.

The specific use-case for Android is because access to the visible file system is dog slow in Android web apps and clunky because the user needs to re-pick files at the start of every sesxion. But without showOpenFilePicker I suppose we'd be stuck with copying in and out (and probably have to "donwload" files from OPFS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants