JSFileSystemFileHandle extension
Represents a handle to a file system entry. The interface is accessed through the window.showOpenFilePicker
method.
Note that read and write operations depend on file-access permissions that do not persist after a page refresh if no other tabs for that origin remain open. The queryPermission method of the FileSystemHandle interface can be used to verify permission state before accessing a file.
Example and more on MDN Web Docs
Methods
-
createSyncAccessHandle(
) → Future< FileSystemSyncAccessHandle> -
Available on FileSystemFileHandle, provided by the JSFileSystemFileHandle extension
Returns a Future 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. -
createWritable(
{bool keepExistingData = false}) → Future< FileSystemWritableFileStream> -
Available on FileSystemFileHandle, provided by the JSFileSystemFileHandle extension
Returns a Future which resolves to a newly created FileSystemWritableFileStream object that can be used to write to a file. -
getFile(
) → Future< File> -
Available on FileSystemFileHandle, provided by the JSFileSystemFileHandle extension
Returns a Future which resolves to a File object representing the state on disk of the entry represented by the handle. -
move(
FileSystemDirectoryHandle directory, {String? name}) → Future< void> -
Available on FileSystemFileHandle, provided by the JSFileSystemFileHandle extension
Move file insidedirectory
, optionally renaming it to newname
. -
rename(
String name) → Future< void> -
Available on FileSystemFileHandle, provided by the JSFileSystemFileHandle extension
Rename file toname
.