File

File Attributes

Describes file attributes.

AttributeTypeDescriptionExamplesStability
file.accessedstringTime when the file was last accessed, in ISO 8601 format. [1]2021-01-01T12:00:00ZExperimental
file.attributesstring[]Array of file attributes. [2]["readonly", "hidden"]Experimental
file.changedstringTime when the file attributes or metadata was last changed, in ISO 8601 format. [3]2021-01-01T12:00:00ZExperimental
file.createdstringTime when the file was created, in ISO 8601 format. [4]2021-01-01T12:00:00ZExperimental
file.directorystringDirectory where the file is located. It should include the drive letter, when appropriate./home/user; C:\Program Files\MyAppExperimental
file.extensionstringFile extension, excluding the leading dot. [5]png; gzExperimental
file.fork_namestringName of the fork. A fork is additional data associated with a filesystem object. [6]Zone.IdentiferExperimental
file.group.idstringPrimary Group ID (GID) of the file.1000Experimental
file.group.namestringPrimary group name of the file.usersExperimental
file.inodestringInode representing the file in the filesystem.256383Experimental
file.modestringMode of the file in octal representation.0640Experimental
file.modifiedstringTime when the file content was last modified, in ISO 8601 format.2021-01-01T12:00:00ZExperimental
file.namestringName of the file including the extension, without the directory.example.pngExperimental
file.owner.idstringThe user ID (UID) or security identifier (SID) of the file owner.1000Experimental
file.owner.namestringUsername of the file owner.rootExperimental
file.pathstringFull path to the file, including the file name. It should include the drive letter, when appropriate./home/alice/example.png; C:\Program Files\MyApp\myapp.exeExperimental
file.sizeintFile size in bytes.Experimental
file.symbolic_link.target_pathstringPath to the target of a symbolic link. [7]/usr/bin/python3Experimental

[1]: This attribute might not be supported by some file systems — NFS, FAT32, in embedded OS, etc.

[2]: Attributes names depend on the OS or file system. Here’s a non-exhaustive list of values expected for this attribute: archive, compressed, directory, encrypted, execute, hidden, immutable, journaled, read, readonly, symbolic link, system, temporary, write.

[3]: file.changed captures the time when any of the file’s properties or attributes (including the content) are changed, while file.modified captures the timestamp when the file content is modified.

[4]: This attribute might not be supported by some file systems — NFS, FAT32, in embedded OS, etc.

[5]: When the file name has multiple extensions (example.tar.gz), only the last one should be captured (“gz”, not “tar.gz”).

[6]: On Linux, a resource fork is used to store additional data with a filesystem object. A file always has at least one fork for the data portion, and additional forks may exist. On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default data stream for a file is just called $DATA. Zone.Identifier is commonly used by Windows to track contents downloaded from the Internet. An ADS is typically of the form: C:\path\to\filename.extension:some_fork_name, and some_fork_name is the value that should populate fork_name. filename.extension should populate file.name, and extension should populate file.extension. The full path, file.path, will include the fork name.

[7]: This attribute is only applicable to symbolic links.