ConstStop an operation started by file.copyAsync, file.moveAsync or file.deleteAsync.
Cancellation takes effect part-way through a batch rather than at the end
of it. A copy or move stops within one file - the file in flight is
aborted and its partial copy removed; a delete stops at the next entry.
Entries already done keep their results, every remaining entry is
reported as skipped / cancelled, and the run still ends with a
file:opComplete carrying cancelled: true. Closing a popup cancels the
operations that popup started; a panel host has no such hook, so its
operations run to the end unless this method stops them.
Copy a file or a whole directory tree, blocking until the copy is done.
Cancellable, non-blocking batch copy. The work runs on a host worker
thread, so unlike file.copy, copying a large album does not freeze
the UI.
Returns a { operationId, totalCount } receipt immediately; the outcome
arrives in batches on file:opProgress, followed by one
file:opComplete. Two paths skip that closing event - the host shutting
down mid-run, and an unexpected host-side failure - so a listener that
must not leak state should carry its own timeout rather than wait on it
forever.
Both events go to the window that made the call while that window is alive. Once it is gone the host can no longer resolve it and falls back to the main instance, so a late event may surface in a window that did not start the operation.
One result is reported per entry, not per file: a directory entry is
reported once its whole tree has been walked. Copying a directory onto an
existing directory merges into it, and files already present there are
skipped without being reported individually, so the entry still reports
status: 'ok'. A file entry whose destination already exists is reported
as skipped / already-exists unless overwrite is set.
Path validation is all-or-nothing: if any entry fails the host's read or
write check, the whole call is rejected with PERMISSION_DENIED and no
operationId is produced. At most 8 operations may be in flight
process-wide.
Delete a file or directory, to the Recycle Bin unless moveToTrash is false.
Cancellable, non-blocking batch delete, with the same receipt-plus-events
contract as file.copyAsync. Results carry no destination.
moveToTrash: true (the default) hands each path to the shell, which
requires the host's main thread, so those deletes run there in batches of
16 and yield in between. moveToTrash: false deletes on a worker thread
and removes non-empty directories, which the synchronous file.delete
refuses to do in that mode.
Check whether a path exists and whether it is a file or a directory.
Describe a file or directory: size, timestamps, and attributes.
List the files and subdirectories of a directory.
Create a directory together with any missing parents.
Move a file or directory, blocking until the move is done.
Cancellable, non-blocking batch move, with the same receipt-plus-events contract as file.copyAsync.
Within one volume a move is a rename and costs nothing regardless of
size. Across volumes the host falls back to copy-then-delete-source; that
entry still reports status: 'ok' but carries reason: 'cross-volume'
so the extra cost is visible. Unlike file.copyAsync, a directory
whose destination already exists is reported as skipped /
already-exists rather than merged.
overwrite covers file destinations only. An existing directory
destination is never replaced, because Windows cannot swap a directory
in place: on the same volume such an entry ends as skipped or failed
instead of overwriting.
Read a file as text, or as Base64 with encoding: "binary".
Read exact bytes; rejects on Host failure or malformed Base64.
Rename a file or directory within its parent directory.
Write text, or bytes decoded from Base64, to a file. Missing parent directories are created first.
Write exact bytes using the host's base64: binary wire format.
Write a canonical Base64 Data URL; rejects malformed input.
file— file-system namespace.