@opfs.js/core
    Preparing search index...

    Interface FileSystemFileHandleNew

    File handle object, extends FileSystemFileHandle.

    interface FileSystemFileHandleNew {
        kind: "file";
        name: string;
        createSyncAccessHandle(
            options?: FileSystemSyncAccessHandleOptions,
        ): Promise<FileSystemSyncAccessHandle>;
        createWritable(
            options?: FileSystemCreateWritableOptions,
        ): Promise<FileSystemWritableFileStream>;
        getFile(): Promise<File>;
        isSameEntry(other: FileSystemHandle): Promise<boolean>;
    }

    Hierarchy

    • FileSystemFileHandle
      • FileSystemFileHandleNew
    Index

    Properties

    kind: "file"

    The kind read-only property of the 'file' if the associated entry is a file or 'directory'.

    MDN Reference

    name: string

    The name read-only property of the handle.

    MDN Reference

    Methods

    • Create a synchronous access handle (FileSystemSyncAccessHandle).

      Parameters

      • Optionaloptions: FileSystemSyncAccessHandleOptions

        Optional object:

        • mode: Synchronous access lock mode, defaults to "readwrite"
          • "read-only": Read-only mode, multiple handles can be opened, can only call read(), getSize(), close() and other methods
          • "readwrite": Exclusive read-write mode, only one handle can exist per file at the same time
          • "readwrite-unsafe": Non-exclusive read-write mode, multiple handles can be opened, but writes may be inconsistent

      Returns Promise<FileSystemSyncAccessHandle>

      Returns synchronous access handle

      NotAllowedError If permission is not granted for readwrite mode

      InvalidStateError If the handle is not in the origin private file system

      NotFoundError If the file is not found

      NoModificationAllowedError If attempting to open multiple handles simultaneously in readwrite mode

    • The createWritable() method of the FileSystemFileHandle interface creates a FileSystemWritableFileStream that can be used to write to a file.

      MDN Reference

      Parameters

      • Optionaloptions: FileSystemCreateWritableOptions

      Returns Promise<FileSystemWritableFileStream>

    • The getFile() method of the If the file on disk changes or is removed after this method is called, the returned js-nolint getFile() None.

      MDN Reference

      Returns Promise<File>

    • The isSameEntry() method of the js-nolint isSameEntry(fileSystemHandle) - FileSystemHandle - : The FileSystemHandle to match against the handle on which the method is invoked.

      MDN Reference

      Parameters

      • other: FileSystemHandle

      Returns Promise<boolean>