Meta: Add "readwrite-unsafe" example to MultipleReadersWriters proposal · whatwg/fs@bd6ef5a
nathanmemmot
·
2023-11-22
·
via Recent Commits to fs:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,8 +13,12 @@
|
13 | 13 | |
14 | 14 | Currently, only one instance of [FileSystemSyncAccessHandle](https://fs.spec.whatwg.org/#api-filesystemsyncaccesshandle) may be open at a time, given a [file system entry](https://fs.spec.whatwg.org/#entry). This explainer proposes a new locking scheme and API changes to support multiple readers and writers for `FileSystemSyncAccessHandle` and an exclusive writer for `FileSystemWritableFileStream`. |
15 | 15 | |
| 16 | +Introducing new locking modes for [FileSystemSyncAccessHandle](https://fs.spec.whatwg.org/#api-filesystemsyncaccesshandle) and [FileSystemWritableFileStream](https://fs.spec.whatwg.org/#api-filesystemwritablefilestream) allows opening either multiple readers/writers or an exclusive writer to a file entry, depending on the application's use case. |
| 17 | + |
16 | 18 | ``` |
17 | 19 | handle.createSyncAccessHandle({ mode: 'read-only' }); |
| 20 | +handle.createSyncAccessHandle({ mode: 'readwrite-unsafe' }); |
| 21 | + |
18 | 22 | handle.createWritable({ mode: 'exclusive' }); |
19 | 23 | ``` |
20 | 24 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。