FileSystemSyncAccessHandle

The FileSystemSyncAccessHandle interface of the File System API represents a synchronous handle to a file system entry. Available only in secure contexts.

MDN Reference

Functions

Link copied to clipboard
fun close()

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.

Link copied to clipboard
fun flush()

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.

Link copied to clipboard

The getSize() method of the FileSystemSyncAccessHandle interface returns the size of the file associated with the handle in bytes.

Link copied to clipboard
fun read(buffer: AllowSharedBufferSource, options: FileSystemReadWriteOptions = definedExternally): UInt53

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.

Link copied to clipboard
fun truncate(newSize: UInt53)

The truncate() method of the FileSystemSyncAccessHandle interface resizes the file associated with the handle to a specified number of bytes.

Link copied to clipboard
fun write(buffer: AllowSharedBufferSource, options: FileSystemReadWriteOptions = definedExternally): UInt53

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.