FileSystemOpfsWeb class abstract

OPFS (Origin Private File System) file system.

Pure type definition, safe to import on any platform.

Inheritance
Available extensions

Constructors

FileSystemOpfsWeb.withFileHandles(List<FileSystemOpfsWebFileHandle> fileHandles)
File system whose root "directory" contains exactly fileHandles, each at /<name> (name being the JS handle name, deduplicated as name (1), name (2), ... on collision).
factory
FileSystemOpfsWeb.withRootHandle(FileSystemOpfsWebDirectoryHandle rootDirectoryHandle)
File system rooted at an existing JS FileSystemDirectoryHandle.
factory

Properties

currentDirectory Directory
A Directory object pointing to the current working directory.
no setterinherited
debugName String

Available on FileSystem, provided by the FileSystemDebugExt extension

debug name
no setter
hashCode int
The hash code for this object.
no setterinherited
hasIdbOptions bool

Available on FileSystem, provided by the FileSystemIdbExt extension

Only true for idb file system.
no setter
idbOptions FileSystemIdbOptions

Available on FileSystem, provided by the FileSystemIdbExt extension

Idb specific options.
no setter
name String
The name of the file system.
no setterinherited
path → Context
The path context for this file system.
no setterinherited
pathContext → Context
Use path instead
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
Whether the file system supports file links.
no setterinherited
Whether the file system supports links.
no setterinherited
supportsRandomAccess bool
Whether the file system supports random access.
no setterinherited

Methods

absolutePath(String path) String

Available on FileSystem, provided by the FsShimFileSystemExtension extension

Absolute path, normalized and with dot separators removed. If path is already absolute, it is returned as is (after normalization and dot separator removal). Otherwise, it is joined with the path of currentDirectory to form an absolute path.
childPath(String path) String
Child path
inherited
directory(String path) Directory
Creates a Directory object.
inherited
directoryWith({String? path}) Directory
Directory from an optional path, null meaning itself for Directory, currentDirectory for FileSystem
inherited
file(String path) File
Creates a File object.
inherited
isDirectory(String path) Future<bool>
Checks if type(path) returns FileSystemEntityType.directory.
inherited
isFile(String path) Future<bool>
Checks if type(path) returns FileSystemEntityType.file.
inherited
Checks if type(path, followLinks: false) returns FileSystemEntityType.link.
inherited
Creates a Link object.
inherited
normalizePath(String path) String

Available on FileSystem, provided by the FsShimFileSystemExtension extension

Normalize a path, removing redundant separators and up-level references.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pathEquals(String path1, String path2) bool

Available on FileSystem, provided by the FsShimFileSystemExtension extension

Path equality based on absolute paths.
pathHashCode(String path) int

Available on FileSystem, provided by the FsShimFileSystemExtension extension

Path hash code based on absolute paths.
sandbox({String? path}) FileSystem

Available on FileSystem, provided by the FsShimFileSystemExtension extension

File system sandboxing Directory from an optional path, null meaning currentDirectory, If the original is a sandbox, the tree is sanitized (i.e. never 2 levels of sandboxing.
toString() String
A string representation of this object.
inherited
type(String path, {bool followLinks = true}) Future<FileSystemEntityType>
Finds the type of file system object that a path points to.
inherited
unsandbox({String? path}) Directory

Available on FileSystem, provided by the FsShimFileSystemExtension extension

Unsandbox a file system, returning the root directory of the sandbox. return currentDirectory if not sandboxed.
withIdbOptions({required FileSystemIdbOptions options}) FileSystem

Available on FileSystem, provided by the FileSystemIdbExt extension

Use a specific pageSize

Operators

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

Static Methods

requestWritePermission(FileSystemOpfsWebFileSystemEntityHandle handle) Future<bool>
Requests the readwrite permission on handle (a FileSystemOpfsWebFileHandle or a FileSystemOpfsWebDirectoryHandle) and returns true if granted.
showDirectoryPicker([FileSystemOpfsWebShowDirectoryPickerOptions? options]) Future<FileSystemOpfsWebDirectoryHandle>
Prompts the user to select a directory using window.showDirectoryPicker() (File System Access API) and returns the resulting FileSystemOpfsWebDirectoryHandle, suitable for withRootHandle.
showOpenFilePicker([FileSystemOpfsWebShowOpenFilePickerOptions? options]) Future<List<FileSystemOpfsWebFileHandle>>
Prompts the user to select one or more files using window.showOpenFilePicker() (File System Access API) and returns the resulting FileSystemOpfsWebFileHandles, suitable for withFileHandles.
showSaveFilePicker([FileSystemOpfsWebShowSaveFilePickerOptions? options]) Future<FileSystemOpfsWebFileHandle>
Prompts the user to select a file to save to using window.showSaveFilePicker() (File System Access API) and returns the resulting FileSystemOpfsWebFileHandle, suitable for withFileHandles.
storageGetDirectory() Future<FileSystemOpfsWebDirectoryHandle>
Returns the OPFS root directory handle using navigator.storage.getDirectory().