Skip to main content
DiskVFS mounts a directory on the host: every file and folder under root appears under the mount, and reads and writes go to the real files. It needs no credentials; see the Disk page.
Node only. A browser has no host filesystem; use OPFS instead.

Install

Configure

capacity: '1GB' caps the bytes the root may hold; see capacity. A mount takes MountMode.READ, WRITE or EXEC; use EXEC when python3 or js should run scripts from the mount.

Fields

Layout

The mount mirrors root: with root: '/srv/files', /data/reports/q1.csv is the file /srv/files/reports/q1.csv.

Behavior

  • Root boundary: a path such as ../../etc/passwd is rejected; every path resolves inside root.
  • One mount per folder: a second disk mount whose root resolves to a folder already mounted is refused; a folder inside one is fine.
  • Folder versions: a version is the folder’s device, inode, change and modified time. Set folderVersions: false for a network or FUSE root (NFS, SMB, rclone, s3fs, Mirage’s own FUSE), whose change time may not move with its entries. A folder changed in the last 2 seconds gets no version and is re-listed until it has been quiet that long.
  • Snapshots: a snapshot carries the mount’s files, and loading it restores them.

VFS.md

The VFS.md an agent reads with Disk mounted at /<path>. <mode> is the mount’s mode: read, write or exec. The commands shown are those of a write mount.
Virtual FilesystemSupported Unix Commands for VFSUnix commands work on each path as on a local filesystem, as far as the path supports them:Limitations of Unix Commands for VFSWhere a path differs from a local filesystem:Run man <cmd> or <cmd> --help for one command’s usage.