In https://github.com/WICG/file-system-access/blob/main/AccessHandle.md#locking-semantics it says:
Creating a File through getFile() would be possible when a lock is in place. The returned File behaves as it currently does in OPFS i.e., it is invalidated if file contents are changed after it was created. It is worth noting that these Files could be used to observe changes done through the new API, even if a lock is still being held.
With something like SQLite (https://jlongster.com/future-sql-web), the read behavior while someone has a lock needs to be very explicitly defined.
The behavior I need to implement is blocking any reads while I have an exclusive write lock. A File might be created after a write is made, but before the file the file is unlocked. I don't think there's any way for me to make sure that a process doesn't read it until the file is unlocked?
I need to be able to write a bunch of data down before anybody else can read it. If they can read it, they might read partial writes which would be up being corrupted data.
Can we implement something more like posix advisory locks? It would be even better if we could have something like locking specific bytes in a file so we can have different types of locks (see fcntl https://man7.org/linux/man-pages/man2/fcntl.2.html). Even just a single byte would be fine.
In https://github.com/WICG/file-system-access/blob/main/AccessHandle.md#locking-semantics it says:
With something like SQLite (https://jlongster.com/future-sql-web), the read behavior while someone has a lock needs to be very explicitly defined.
The behavior I need to implement is blocking any reads while I have an exclusive write lock. A
Filemight be created after awriteis made, but before the file the file is unlocked. I don't think there's any way for me to make sure that a process doesn't read it until the file is unlocked?I need to be able to write a bunch of data down before anybody else can read it. If they can read it, they might read partial writes which would be up being corrupted data.
Can we implement something more like posix advisory locks? It would be even better if we could have something like locking specific bytes in a file so we can have different types of locks (see fcntl https://man7.org/linux/man-pages/man2/fcntl.2.html). Even just a single byte would be fine.