FileSystemSyncAccessHandle extension type

The FileSystemSyncAccessHandle interface of the File System API represents a synchronous handle to a file system entry.

This class is only accessible inside dedicated Web Workers (so that its methods do not block execution on the main thread) for files within the origin private file system, which is not visible to end-users.

As a result, its methods are not subject to the same security checks as methods running on files within the user-visible file system, and so are much more performant. This makes them suitable for significant, large-scale file updates such as SQLite database modifications.

The interface is accessed through the FileSystemFileHandle.createSyncAccessHandle method.

Note: In earlier versions of the spec, FileSystemSyncAccessHandle.close, FileSystemSyncAccessHandle.flush, FileSystemSyncAccessHandle.getSize, and FileSystemSyncAccessHandle.truncate were wrongly specified as asynchronous methods, and older versions of some browsers implement them in this way. However, all current browsers that support these methods implement them as synchronous methods.

on
Implemented types

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
The close() method of the FileSystemSyncAccessHandle interface closes an open synchronous file handle, disabling any further operations on it and releasing the exclusive lock previously put on the file associated with the file handle.
flush() → void
The flush() method of the FileSystemSyncAccessHandle interface persists any changes made to the file associated with the handle via the FileSystemSyncAccessHandle.write method to disk.
getSize() int
The getSize() method of the FileSystemSyncAccessHandle interface returns the size of the file associated with the handle in bytes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(AllowSharedBufferSource buffer, [FileSystemReadWriteOptions options]) int
The read() method of the FileSystemSyncAccessHandle interface reads the content of the file associated with the handle into a specified buffer, optionally at a given offset.
toString() String
A string representation of this object.
inherited
truncate(int newSize) → void
The truncate() method of the FileSystemSyncAccessHandle interface resizes the file associated with the handle to a specified number of bytes.
write(AllowSharedBufferSource buffer, [FileSystemReadWriteOptions options]) int
The write() method of the FileSystemSyncAccessHandle interface writes the content of a specified buffer to the file associated with the handle, optionally at a given offset.

Operators

operator ==(Object other) bool
The equality operator.
inherited