Metadata
Metadata about a single filesystem entry.
Returned by metadata,
Path.metadata, and
File.metadata. For filesystem-level capacity and
mount metadata, use FsMetadata.
Accessing a field that does not apply to the target platform raises
FieldError. freebsd_attrs, linux_attrs,
macos_attrs, and related attribute fields are nil when the filesystem or
file type does not support querying file attributes.
Fields
accessed @ time.DateTimeLast access time.
append_only @ BoolWhether the platform append-only flag is set.
archive @ BoolWhether the archive attribute is set. Windows only.
blksize @ IntPreferred block size for I/O. Unix only.
blocks @ IntNumber of allocated 512-byte blocks. Unix only.
casefold @ BoolWhether the case-insensitive-directory-lookups flag is set. Linux only.
compressed @ BoolWhether the platform compressed flag is set.
created @ time.DateTimeCreation or status-change time.
data_journaling @ BoolWhether the data-journaling flag is set. Linux only.
dev @ IntDevice ID. Unix only.
dir_sync @ BoolWhether the synchronous-directory-updates flag is set. Linux only.
direct_access @ BoolWhether the direct-access flag is set. Linux only.
encrypted @ BoolWhether the encrypted attribute is set. Windows only.
extent_format @ BoolWhether the extent-format flag is set. Linux only.
freebsd_attrs @ IntRaw FreeBSD file flags. FreeBSD only.
gid @ IntOwner group ID. Unix only.
groupOwning group: the gid as an
Inton Unix, or the primary groupSidon Windows.This representation matches the
groupargument accepted byupdate_metadata.hidden @ BoolWhether the platform hidden flag is set.
immutable @ BoolWhether the platform immutable flag is set.
ino @ IntInode number. Unix only.
linux_attrs @ IntRaw Linux attribute flags. Linux only.
macos_attrs @ IntRaw macOS file flags. macOS only.
mode @ fs.unix.ModePermissions and file type. Unix only.
modified @ time.DateTimeLast modification time.
nlink @ IntHard-link count. Unix only.
no_atime @ BoolWhether the no-atime flag is set. Linux only.
no_compress @ BoolWhether the don't-compress flag is set. Linux only.
no_copy_on_write @ BoolWhether the no-copy-on-write flag is set. Linux only.
no_dump @ BoolWhether the platform no-dump flag is set.
no_tail_merge @ BoolWhether the no-tail-merging flag is set. Linux only.
not_content_indexed @ BoolWhether the not-content-indexed attribute is set. Windows only.
offline @ BoolWhether the offline attribute is set. Windows only.
opaque @ BoolWhether the opaque flag is set. macOS only.
ownerOwner: the uid as an
Inton Unix, or the ownerSidon Windows.This representation matches the
ownerargument accepted byupdate_metadata.project_inherit @ BoolWhether the project-hierarchy flag is set. Linux only.
rdev @ IntSpecial-device ID. Unix only.
readonly @ BoolWhether the readonly attribute is set. Windows only.
reparse_point @ BoolWhether the reparse-point attribute is set. Windows only.
secure_delete @ BoolWhether the secure-deletion flag is set. Linux only.
size @ IntFile size in bytes.
sparse @ BoolWhether sparse allocation is enabled. Windows only.
sync @ BoolWhether the synchronous-updates flag is set. Linux only.
system @ BoolWhether the system attribute is set. Windows only.
temporary @ BoolWhether the temporary attribute is set. Windows only.
top_dir @ BoolWhether the top-of-directory-hierarchy flag is set. Linux only.
type @ FileTypeFile type.
uid @ IntOwner user ID. Unix only.
undelete @ BoolWhether the undeletable flag is set. Linux only.
win_attrs @ IntRaw Windows file attribute bitmask. Windows only.