WebKit / standards-positions

WebKit's positions on emerging web specifications
https://webkit.org/standards-positions/
241 stars 18 forks source link

Multiple Readers and Writers in File System Access API #238

Open nathanmemmott opened 11 months ago

nathanmemmott commented 11 months ago

WebKittens

@annevk @szewai

Title of the spec

Multiple Readers and Writers in File System Access API

URL to the spec

https://fs.spec.whatwg.org/

URL to the spec's repository

https://github.com/whatwg/fs/

Issue Tracker URL

No response

Explainer URL

https://github.com/whatwg/fs/blob/main/proposals/MultipleReadersWriters.md

TAG Design Review URL

https://github.com/w3ctag/design-reviews/issues/845

Mozilla standards-positions issue URL

https://github.com/mozilla/standards-positions/issues/861

WebKit Bugzilla URL

No response

Radar URL

No response

Description

Currently, only one FileSystemSyncAccessHandle may be open at a time per file, preventing an origin from reading the same file from multiple tabs easily. Conversely, multiple FileSystemWritableFileStream can be simultaneously open, letting multiple writers clobber each other.

Introducing new “create” modes for FileSystemSyncAccessHandle and FileSystemWritableFileStream allows opening either multiple readers/writers or an exclusive writer to a file entry, depending on the application's use case.

handle.createSyncAccessHandle({ mode: 'read-only' });
handle.createWritable({ mode: ‘exclusive’ });