Comments (2)
Would Storage Buckets address this use case? The current implementation only works with IndexedDB, but the eventual plan is to enable it for other storage methods as well.
Plausibly, though from reading the explainer it seems that deletion is still in general lazy, i.e. when disk storage becomes high. Like if I do the following:
class Archive {
static async create() {
const bucketId = crypto.randomUUID();
const bucket = navigator.storageBuckets.open(this.#bucketId, { persistent: false });
return new Archive(bucketId, bucket);
}
constructor(bucketId, bucket) {
this.#bucketId = bucketId;
this.#bucket = bucket;
}
addFile(fileName, blobSource) {
const rootDir = await this.#bucket.getDirectory();
const filesDir = await rootDir.getDirectoryHandle("files", { create: true });
// add file to files dir
}
async encode() {
const dir = await this.#bucket.getDirectory();
const archive = await dir.getFileHandle("archive.ext", { create: true });
// encode things to the archive
return archive;
}
async dispose() {
await navigator.storageBuckets.delete(this.#bucketId);
}
}
and create an archive, and close the page before .dispose()
is called, then files within the storage bucket will still be on disk until disk usage is high. Thus it'd be wasting disk space for something that will never be accessed again.
From the issues on storage buckets it seems like session buckets is probably the most appropriate place for this, so I'll close this issue.
from fs.
Would Storage Buckets address this use case? The current implementation only works with IndexedDB, but the eventual plan is to enable it for other storage methods as well.
from fs.
Related Issues (20)
- proposals/MultipleReadersWriters.md
- File and Directory Watch Functionality for the FileSystem API HOT 1
- Clarify behavior of `createWritable()` when the corresponding file does not exist HOT 1
- Add a `FileSystemHandle.create()` method to create self
- Define File's type better (getFile()) HOT 6
- Define the Bucket File System in terms of the Storage spec
- Why is WirteParams's data both optional and nullable?
- Editorial: string formatting
- Support locking of directory entries
- Require taking a lock to remove an entry HOT 1
- FYI: TPAC 2023 WICG breakout session
- New Modes of Creating a FileSystemWritableFileStream HOT 3
- No explicit file lock release when `write()` throws an exception HOT 3
- Origin Private File System – identification of buckets (similarly to FAS API showSaveFilePicker) HOT 3
- Using F_FULLFSYNC for flush() causing slow performance on Mac HOT 1
- getFile() shouldn't require a copy of the underlying data HOT 5
- Add a FileSystemFileHandle copy method
- Hyuuhhh
- POSIX style path access for OPFS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fs.