Extended file attributes
Extended file attributes are
In Unix-like systems, extended attributes are usually abbreviated as xattr.[1]
Implementations
AIX
In
BeOS/Haiku
In the now-defunct BeOS and successors like Haiku, extended file attributes are widely used in base and third-party programs. The
FreeBSD
In
Linux
In
Support for the extended attribute concept from a POSIX.1e draft[citation needed] that had been withdrawn[12] in 1997 was added to Linux around 2002.[13][14] As of 2016, they are not yet in widespread use by user-space Linux programs, but are used by
.The Linux kernel allows extended attribute to have names of up to 255 bytes and values of up to 64 KiB,[15] as do XFS and ReiserFS, but ext2/3/4 and btrfs 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,[citation needed] 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.[16]
Extended attributes can be accessed and modified using the getfattr
and setfattr
commands from the attr
package on most distributions.[17] The APIs are called getxattr
and setxattr
.
macOS
Each attribute consists of a name and the associated data. The name is a null-terminated Unicode 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 Identifiers) as the attribute name.
macOS supports listing,[18] getting,[19] setting,[20] and removing[21] extended attributes from files or directories using a Linux-like API. From the command line, these abilities are exposed through the xattr utility.[22]
Since macOS 10.5, files originating from the web are marked with com.apple.quarantine
via extended file attributes.[23] In some older versions of macOS (such as Mac OS X 10.6), user space extended attributes were not preserved on save in common Cocoa applications (TextEdit, Preview etc.).[citation needed]
OpenBSD
Support for extended file attributes was removed from the
OS/2
In OS/2 version 1.2 and later, the High Performance File System was designed with extended attributes in mind, but support for them was also retro-fitted on the FAT filesystem of DOS.
For compatibility with other operating systems using a FAT partition, OS/2 attributes are stored inside a single file "EA DATA. SF
" 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
Parts of OS/2 version 2.0 and later such as the
Solaris
Version 4 of the Network File System supports extended attributes in much the same way as Solaris.
Windows NT
On
Additionally, NTFS can store arbitrary-length extended attributes in the form of alternate data streams (ADS), a type of resource fork. Plugins for the file manager Total Commander, like NTFS Descriptions and QuickSearch eXtended support filtering the file list by or searching for metadata contained in ADS.[28][29] NTFS-3G supports mapping ADS to extended attributes in FUSE; it also maps file attributes that way.[30]
See also
- Attribute–value pair
- File attribute
References
- ^ Linux Programmer's Manual – Overview, Conventions and Miscellanea –
- AIX V7.2 documentation. IBM. Retrieved 2017-07-11.
- ^ "getea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 1. IBM. Retrieved 2017-07-11.
- ^ "setea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved 2017-07-11.
- ^ "listea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 1. IBM. Retrieved 2017-07-11.
- ^ "statea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved 2017-07-11.
- ^ "removeea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved 2017-07-11.
- ^ "Attributes". Haiku User Guide. Haiku, Inc. Retrieved 28 January 2021.
- ^ "Workshop: Managing Emails". Haiku User Guide. Haiku, Inc. Retrieved 28 January 2021.
- ^ FreeBSD System Calls Manual –
- ^ Kim, Jaegeuk (2012-10-05). "[PATCH 13/16] f2fs: add xattr and acl functionalities". Retrieved 2017-07-11.
- ^ Schaufler, Casey (2002-04-30). "Posix.1e?". Newsgroup: comp.security.unix.
- ^ "v2.5.3 git commit log". 2002-02-05. Retrieved 2017-07-11.
- ^ "Red Hat Enterprise Linux AS 3 Release Notes (x86 Edition)". Red Hat. 2003. Archived from the original on 2017-07-09. Retrieved 2017-07-11.
EA (Extended Attributes) and ACL (Access Control Lists) functionality is now available for ext3 file systems. In addition, ACL functionality is available for NFS.
- ^ "linux/include/uapi/linux/limits.h". 2012-10-13. Retrieved 2017-07-11.
- ^ Linux Programmer's Manual – Overview, Conventions and Miscellanea –
- ^ "Commands for Manipulating Filesystem Extended Attributes". GNU Savannah. Retrieved 2017-07-11.
- ^ Darwin and macOS System Calls Manual –
- ^ Darwin and macOS System Calls Manual –
- ^ Darwin and macOS System Calls Manual –
- ^ Darwin and macOS System Calls Manual –
- ^ Darwin and macOS General Commands Manual –
- ^ "Launch Services Release Notes". developer.apple.com.
- ^ Dale Rahn (2005-07-03). "CVS log for src/sys/ufs/ufs/Attic/extattr.h".
- ^ a b Eager, Bob (2000-10-28). "Implementation of extended attributes on the FAT file system". Retrieved 2017-07-11.
- Solaris 11.4 Standards, Environments, Macros, Character Sets, and Miscellany Reference Manual
- MSDN. Retrieved 2017-07-11.
- ^ "NTFS Descriptions 1.2.1". TotalCmd.net. Retrieved 16 April 2018.
- ^ "QuickSearch eXtended". TotalCmd.net. Retrieved 16 April 2018.
- ^ "Extended Attributes". Tuxera. Archived from the original on 2020-08-14.