Skip to content

FsMetadata

Metadata about a filesystem as a whole.

Returned by fs_metadata, Path.fs_metadata, and File.fs_metadata. For metadata about a single file entry, use Metadata.

Platform-specific members belong to fs.unix.FsMetadata and fs.windows.FsMetadata.

Fields

available @ Int [get]

Free space available to the current process in bytes.

block_size @ (Int | nil) [get]

Filesystem block size in bytes when available.

capacity @ Int [get]

Total filesystem capacity in bytes.

free @ Int [get]

Total free space in bytes, including space reserved from unprivileged users.

read_only @ Bool [get]

Whether the filesystem is mounted read-only.

type @ (Str | nil) [get]

Filesystem type name as the platform reports it, such as ext4, fuse.sshfs, apfs, or NTFS, or nil when it can't be determined.

Names aren't normalized across platforms.

echo $fs_metadata(".").type