Extended file attributes are
file system
In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
features that enable users to associate
computer file
A computer file is a computer resource for recording data in a computer storage device, primarily identified by its file name. Just as words can be written to paper, so can data be written to a computer file. Files can be shared with and transfe ...
s with
metadata
Metadata is "data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including:
* Descriptive metadata – the descriptive ...
not interpreted by the filesystem, whereas regular attributes have a purpose strictly defined by the filesystem (such as
permissions or records of creation and modification times). Unlike
forks
In cutlery or kitchenware, a fork (from la, furca 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods ei ...
, which can usually be as large as the maximum file size, extended attributes are usually limited in size to a value significantly smaller than the maximum file size. Typical uses include storing the author of a document, the
character encoding
Character encoding is the process of assigning numbers to Graphics, graphical character (computing), characters, especially the written characters of Language, human language, allowing them to be Data storage, stored, Data communication, transmi ...
of a plain-text document, or a
checksum
A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
,
cryptographic hash
A cryptographic hash function (CHF) is a hash algorithm (a map of an arbitrary binary string to a binary string with fixed size of n bits) that has special properties desirable for cryptography:
* the probability of a particular n-bit output ...
or
digital certificate
In cryptography, a public key certificate, also known as a digital certificate or identity certificate, is an electronic document used to prove the validity of a Key authentication, public key. The certificate includes information about the key, i ...
, and
discretionary access control
In computer security, discretionary access control (DAC) is a type of access control defined by the Trusted Computer System Evaluation Criteria (TCSEC) as a means of restricting access to objects based on the identity of subjects and/or groups to w ...
information.
In
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems, extended attributes are usually abbreviated as xattr.
Implementations
AIX
In
AIX
Aix or AIX may refer to:
Computing
* AIX, a line of IBM computer operating systems
*An Alternate Index, for a Virtual Storage Access Method Key Sequenced Data Set
* Athens Internet Exchange, a European Internet exchange point
Places Belgi ...
, the JFS2 v2 filesystem supports extended attributes, which are accessible using the command. The , , , , and APIs support fetching, setting, listing, getting information about, and removing extended attributes.
BeOS/Haiku
In the now-defunct
BeOS
BeOS is an operating system for personal computers first developed by Be Inc. in 1990. It was first written to run on BeBox hardware.
BeOS was positioned as a multimedia platform that could be used by a substantial population of desktop users a ...
and successors like
Haiku
is a type of short form poetry originally from Japan. Traditional Japanese haiku consist of three phrases that contain a ''kireji'', or "cutting word", 17 '' on'' (phonetic units similar to syllables) in a 5, 7, 5 pattern, and a ''kigo'', or se ...
, extended file attributes are widely used in base and third-party programs.
The
Be File System
The Be File System (BFS) is the native file system for the BeOS. In the Linux kernel, it is referred to as "BeFS" to avoid confusion with Boot File System.
BFS was developed by Dominic Giampaolo and Cyril Meurillon over a ten-month period, start ...
allows the indexing and querying of attributes, essentially giving the filesystem
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases sp ...
-like characteristics. The uses of extended attributes in Be-like systems are varied: For example,
Tracker and
OpenTracker
Opentracker is a free (licensed as beerware) BitTorrent peer tracker software (a special kind of HTTP or UDP server software) that is designed to be fast and to have a low consumption of system resources.
Features
Several instances of op ...
, the file-managers of BeOS and Haiku respectively, both store the locations of file icons in attributes, Haiku's "Mail" service stores all message content and metadata in extended file attributes, and the MIME types of files are stored in their attributes. Extended file attributes can be viewed and edited in Be-like systems' GUI through the file-manager, often Tracker or derivatives thereof.
FreeBSD
In
FreeBSD
FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
5.0 and later, the
UFS1, UFS2, and ZFS filesystems support extended attributes, using the family of system calls. Any regular file may have a list of extended attributes. Each attribute consists of a name and the associated data. The name must be a
null-terminated string
In computer programming, a null-terminated string is a character string stored as an array containing the characters and terminated with a null character (a character with a value of zero, called NUL in this article). Alternative names are C stri ...
, and exists in a namespace identified by a small-integer namespace identifier. Currently, two namespaces exist: user and system. The user namespace has no restrictions with regard to naming or contents. The system namespace is primarily used by the kernel for
access control list
In computer security, an access-control list (ACL) is a list of permissions associated with a system resource (object). An ACL specifies which users or system processes are granted access to objects, as well as what operations are allowed on giv ...
s and
mandatory access control
In computer security, mandatory access control (MAC) refers to a type of access control by which the operating system or database constrains the ability of a ''subject'' or ''initiator'' to access or generally perform some sort of operation on a ...
.
Linux
In
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, the
ext2
The ext2 or second extended file system is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same pr ...
,
ext3
ext3, or third extended filesystem, is a journaled file system that is commonly used by the Linux kernel. It used to be the default file system for many popular Linux distributions. Stephen Tweedie first revealed that he was working on extend ...
,
ext4
ext4 (fourth extended filesystem) is a journaling file system for Linux, developed as the successor to ext3.
ext4 was initially a series of backward-compatible extensions to ext3, many of them originally developed by Cluster File Systems for ...
,
JFS,
Squashfs
Squashfs is a compressed read-only file system for Linux. Squashfs compresses files, inodes and directories, and supports block sizes from 4 KiB up to 1 MiB for greater compression. Several compression algorithms are supported. Squashfs is al ...
,
UBIFS
UBIFS (UBI File System, more fully Unsorted Block Image File System) is a flash file system for unmanaged flash memory devices.
UBIFS works on top of an UBI (unsorted block image) layer, which is itself on top of a memory technology device (MT ...
,
Yaffs2,
ReiserFS
ReiserFS is a general-purpose, journaling file system initially designed and implemented by a team at Namesys led by Hans Reiser and licensed under GPLv2. Introduced in version 2.4.1 of the Linux kernel, it was the first journaling file sys ...
,
Reiser4
Reiser4 is a computer file system, successor to the ReiserFS file system, developed from scratch by Namesys and sponsored by DARPA as well as Linspire. Reiser4 was named after its former lead developer Hans Reiser. , the Reiser4 patch set is ...
,
XFS
XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993. It was the default file system in SGI's IRIX operating system starting with its version 5.3. XFS was ported to the Linux kernel in 2001; as ...
,
Btrfs
Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or simply by spelling it out) is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (not to be confused ...
,
OrangeFS,
Lustre
Lustre or Luster may refer to:
Places
* Luster, Norway, a municipality in Vestlandet, Norway
** Luster (village), a village in the municipality of Luster
* Lustre, Montana, an unincorporated community in the United States
Entertainment
* '' ...
,
OCFS2 1.6,
ZFS
ZFS (previously: Zettabyte File System) is a file system with volume management capabilities. It began as part of the Sun Microsystems Solaris operating system in 2001. Large parts of Solaris – including ZFS – were published under an ope ...
, and
F2FS
F2FS (Flash-Friendly File System) is a flash file system initially developed by Samsung Electronics for the Linux kernel.
The motive for F2FS was to build a file system that, from the start, takes into account the characteristics of NAND flash ...
filesystems support extended attributes (abbreviated ''xattr'') when enabled in the kernel configuration. Any regular file or directory may have extended attributes consisting of a name and associated data. The name must be a
null-terminated string
In computer programming, a null-terminated string is a character string stored as an array containing the characters and terminated with a null character (a character with a value of zero, called NUL in this article). Alternative names are C stri ...
prefixed by a
namespace
In computing, a namespace is a set of signs (''names'') that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified.
Namespaces ...
identifier and a dot character. Currently, four namespaces exist: user, trusted, security and system. The user namespace has no restrictions with regard to naming or contents. The system namespace is primarily used by the kernel for
access control list
In computer security, an access-control list (ACL) is a list of permissions associated with a system resource (object). An ACL specifies which users or system processes are granted access to objects, as well as what operations are allowed on giv ...
s. The security namespace is used by
SELinux
Security-Enhanced Linux (SELinux) is a Linux kernel security module that provides a mechanism for supporting access control security policies, including mandatory access controls (MAC).
SELinux is a set of kernel modifications and user-space t ...
, for example.
Support for the extended attribute concept from a POSIX.1e draft that had been withdrawn in 1997 was added to Linux around 2002.
As of 2016, they are not yet in widespread use by user-space Linux programs, but are used by
Beagle
The beagle is a breed of small scent hound, similar in appearance to the much larger foxhound. The beagle was developed primarily for hunting hare, known as beagling. Possessing a great sense of smell and superior tracking instincts, the ...
,
OpenStack Swift
OpenStack is a free software, free, open-source software, open standard cloud computing platform. It is mostly deployed as Cloud computing#Infrastructure as a service (IaaS), infrastructure-as-a-service (IaaS) in both public and private clouds w ...
,
Dropbox
Dropbox is a file hosting service operated by the American company Dropbox, Inc., headquartered in San Francisco, California, U.S. that offers cloud storage, file synchronization, personal cloud, and Client (computing), client software. Dropb ...
,
KDE
KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that allow collaborative work on this kind of software. Well-known products include the ...
's semantic metadata framework (Baloo),
Chromium
Chromium is a chemical element with the symbol Cr and atomic number 24. It is the first element in group 6. It is a steely-grey, lustrous, hard, and brittle transition metal.
Chromium metal is valued for its high corrosion resistance and hardne ...
,
Wget
GNU Wget (or just Wget, formerly Geturl, also written as its package name, wget) is a computer program that retrieves content from web servers. It is part of the GNU Project. Its name derives from "World Wide Web" and " ''get''." It supports dow ...
and
cURL
cURL (pronounced like "curl", UK: , US: ) is a computer software project providing a library (libcurl) and command-line tool (curl) for transferring data using various network protocols. The name stands for "Client URL".
History
cURL was fi ...
.
The Linux kernel allows extended attribute to have names of up to 255 bytes and values of up to 64 KiB,
as do
XFS
XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993. It was the default file system in SGI's IRIX operating system starting with its version 5.3. XFS was ported to the Linux kernel in 2001; as ...
and
ReiserFS
ReiserFS is a general-purpose, journaling file system initially designed and implemented by a team at Namesys led by Hans Reiser and licensed under GPLv2. Introduced in version 2.4.1 of the Linux kernel, it was the first journaling file sys ...
, but
ext2
The ext2 or second extended file system is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same pr ...
/
3/
4 and
btrfs
Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or simply by spelling it out) is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (not to be confused ...
impose much smaller limits, requiring all the attributes (names and values) of one file to fit in one "filesystem block" (usually 4 KiB). Per POSIX.1e, the names are required to start with one of ''security'', ''system'', ''trusted'', and ''user'' plus a period. This defines the four namespaces of extended attributes.
Extended attributes can be accessed and modified using the
getfattr
and
setfattr
commands from the
attr
package on most distributions. The APIs are called and .
macOS
Mac OS X 10.4
Mac OS X Tiger (version 10.4) is the 5th major release of macOS, Apple's desktop and server operating system for Mac computers. Tiger was released to the public on April 29, 2005 for US$129.95 as the successor to Mac OS X 10.3 Panther. Som ...
and later support extended attributes by making use of the
HFS+
HFS Plus or HFS+ (also known as Mac OS Extended or HFS Extended) is a journaling file system developed by Apple Inc. It replaced the Hierarchical File System (HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8.1 ...
filesystem Attributes File
B*-tree
In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing for ...
feature which allows for named forks. Although the named forks in HFS+ support arbitrarily large amounts of data through extents, the OS support for extended attributes only supports inline attributes, limiting their size to that which can fit within a single B*-tree node. Any regular file may have a list of extended attributes. HFS+ supports an arbitrary number of named forks, and it is unknown if
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
imposes any limit on the number of extended attributes.
Each attribute consists of a name and the associated data. The name is a
null-terminated Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expre ...
string. No namespace restrictions are present (making this an ''open xattr'' system) and the convention is to use a reverse DNS string (similar to
Uniform Type Identifier
A Uniform Type Identifier (UTI) is a text string used on software provided by Apple Inc. to uniquely identify a given class or type of item. Apple provides built-in UTIs to identify common system objects – document or image file types, folders a ...
s) as the attribute name.
macOS supports listing, getting, setting, and removing extended attributes from files or directories using a Linux-like API. From the command line, these abilities are exposed through the ''xattr'' utility.
Since macOS 10.5, files originating from the web are marked with
com.apple.quarantine
via extended file attributes. In some older versions of macOS (such as
Mac OS X 10.6
Mac OS X Snow Leopard (version 10.6) is the seventh major release of macOS, Apple's desktop and server operating system for Macintosh computers.
Snow Leopard was publicly unveiled on June 8, 2009 at Apple’s Worldwide Developers Conference. ...
), user space extended attributes were not preserved on save in common
Cocoa
Cocoa may refer to:
Chocolate
* Chocolate
* ''Theobroma cacao'', the cocoa tree
* Cocoa bean, seed of ''Theobroma cacao''
* Chocolate liquor, or cocoa liquor, pure, liquid chocolate extracted from the cocoa bean, including both cocoa butter and ...
applications (TextEdit, Preview etc.).
OpenBSD
Support for extended file attributes was removed from the
OpenBSD
OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project em ...
source code in 2005 due to a lack of interest in
Access Control Lists
In computer security, an access-control list (ACL) is a list of permissions associated with a system resource (object). An ACL specifies which users or system processes are granted access to objects, as well as what operations are allowed on giv ...
.
OS/2
In
OS/2
OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 ...
version 1.2 and later, the
High Performance File System
HPFS (High Performance File System) is a file system created specifically for the OS/2 operating system to improve upon the limitations of the FAT file system. It was written by Gordon Letwin and others at Microsoft and added to OS/2 version 1 ...
was designed with extended attributes in mind, but support for them was also retro-fitted on the
FAT
In nutrition science, nutrition, biology, and chemistry, fat usually means any ester of fatty acids, or a mixture of such chemical compound, compounds, most commonly those that occur in living beings or in food.
The term often refers spec ...
filesystem of DOS.
For compatibility with other operating systems using a FAT partition, OS/2 attributes are stored inside a single file "" located in the root directory. This file is normally inaccessible when an operating system supporting extended attributes manages the disk, but can be freely manipulated under, for example, DOS. Files and directories having extended attributes use one or more
clusters inside this file. The logical cluster number of the first used cluster is stored inside the owning file's or directory's
directory entry.
These two bytes are used for other purposes on the FAT32 filesystem, and hence OS/2 extended attributes cannot be stored on this filesystem.
Parts of OS/2 version 2.0 and later such as the
Workplace Shell
The Workplace Shell (WPS) is an object-oriented desktop shell (also called desktop environment) produced by IBM's Boca Raton development lab for OS/2 2.0. It is based on Common User Access and made a radical shift away from the Program Manager ...
uses several standardized extended attributes (also called ''EAs'') for purposes like identifying the filetype, comments,
computer icon
In computing, an icon is a pictogram or ideogram displayed on a computer screen in order to help the user navigate a computer system. The icon itself is a quickly comprehensible symbol of a software tool, function, or a data file, accessible on th ...
s and keywords about the file.
Programs written in the interpreted language
Rexx
Rexx (Restructured Extended Executor) is a programming language that can be interpreted or compiled. It was developed at IBM by Mike Cowlishaw. It is a structured, high-level programming language designed for ease of learning and reading. ...
store an already
parse
Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Lati ...
d version of the code as an extended attribute, to allow faster execution.
Solaris
Solaris
Solaris may refer to:
Arts and entertainment Literature, television and film
* ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem
** ''Solaris'' (1968 film), directed by Boris Nirenburg
** ''Solaris'' (1972 film), directed by ...
version 9 and later allows files to have "extended attributes", which are actually
fork
In cutlery or kitchenware, a fork (from la, furca 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods ei ...
s; the maximum size of an "extended attribute" is the same as the maximum size of a file, and they are read and written in the same fashion as files. Internally, they are actually stored and accessed like normal files, so their names cannot contain "/" characters and their ownership and permissions can differ from those of the parent file.
Version 4 of the
Network File System
Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems (Sun) in 1984, allowing a user on a client computer to access files over a computer network much like local storage is accessed. NFS, like ...
supports extended attributes in much the same way as Solaris.
Windows NT
On
Windows NT
Windows NT is a proprietary graphical operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems sc ...
, limited-length extended attributes are supported by
FAT
In nutrition science, nutrition, biology, and chemistry, fat usually means any ester of fatty acids, or a mixture of such chemical compound, compounds, most commonly those that occur in living beings or in food.
The term often refers spec ...
,
HPFS, and
NTFS
New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred fil ...
. This was implemented as part of the
OS/2 subsystem. They are notably used by the
NFS server of the
Interix
Interix was an optional, POSIX-conformant Unix subsystem for Windows NT operating systems. Interix was a component of Windows Services for UNIX, and a superset of the Microsoft POSIX subsystem. Like the POSIX subsystem, Interix was an environment ...
POSIX subsystem in order to implement Unix-like permissions. The
Windows Subsystem for Linux
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
added in the
Windows 10 Anniversary Update uses them for similar purposes, storing the Linux file mode, owner, device ID (if applicable), and file times in the extended attributes.
Additionally,
NTFS
New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred fil ...
can store arbitrary-length extended attributes in the form of
alternate data streams
New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred file ...
(ADS), a type of
resource fork The resource fork is a fork or section of a file on Apple's classic Mac OS operating system, which was also carried over to the modern macOS for compatibility, used to store structured data along with the unstructured data stored within the data f ...
. Plugins for the file manager
Total Commander
__NOTOC__
Total Commander (formerly Windows Commander) is a shareware orthodox file manager for Windows, Windows Phone, Windows Mobile/Windows CE and Android, developed by Christian Ghisler. Originally coded using Delphi, latest Windows 64-b ...
, like ''NTFS Descriptions'' and ''QuickSearch eXtended'' support filtering the file list by or searching for metadata contained in ADS.
NTFS-3G
NTFS-3G is an open-source cross-platform implementation of the Microsoft Windows NTFS file system with read/write support. NTFS-3G often uses the FUSE file system interface, so it can run unmodified on many different operating systems. It is r ...
supports mapping ADS to extended attributes in
FUSE
Fuse or FUSE may refer to:
Devices
* Fuse (electrical), a device used in electrical systems to protect against excessive current
** Fuse (automotive), a class of fuses for vehicles
* Fuse (hydraulic), a device used in hydraulic systems to protect ...
; it also maps file attributes that way.
See also
*
Attribute–value pair
*
File attribute File attributes are a type of meta-data that describe and may modify how files and/or directories in a filesystem behave. Typical file attributes may, for example, indicate or specify whether a file is visible, modifiable, compressed, or encrypted. ...
References
{{Computer files
Computer file systems
Metadata