createSyncAccessHandle method

JSPromise<FileSystemSyncAccessHandle> createSyncAccessHandle()

@AvailableInWorkers("dedicated")

The createSyncAccessHandle() method of the FileSystemFileHandle interface returns a Promise which resolves to a FileSystemSyncAccessHandle object that can be used to synchronously read from and write to a file. The synchronous nature of this method brings performance advantages, but it is only usable inside dedicated Web Workers for files within the origin private file system.

Creating a FileSystemSyncAccessHandle takes an exclusive lock on the file associated with the file handle. This prevents the creation of further FileSystemSyncAccessHandles or FileSystemWritableFileStreams for the file until the existing access handle is closed.

Implementation

external JSPromise<FileSystemSyncAccessHandle> createSyncAccessHandle();