Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Extended file attributes

From Wikipedia, the free encyclopedia
Set of file system features

Extended file attributes arefile system features that enable users to associatecomputer files withmetadata not interpreted by the filesystem, whereas regular attributes have a purpose strictly defined by the filesystem (such aspermissions or records of creation and modification times). Unlikeforks, 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, thecharacter encoding of a plain-text document, or achecksum,cryptographic hash ordigital certificate, anddiscretionary access control information.

InUnix-like systems, extended attributes are usually abbreviated asxattr.[1]

Implementations

[edit]

AIX

[edit]

InAIX, the JFS2 v2 filesystem supports extended attributes, which are accessible using thegetea command.[2] Thegetea,[3]setea,[4]listea,[5]statea,[6] andremoveea[7] APIs support fetching, setting, listing, getting information about, and removing extended attributes.

BeOS/Haiku

[edit]

In the now-defunctBeOS and successors likeHaiku, extended file attributes are widely used in base and third-party programs. TheBe File System allows the indexing and querying of attributes, essentially giving the filesystemdatabase-like characteristics. The uses of extended attributes in Be-like systems are varied: For example,Tracker andOpenTracker, the file-managers of BeOS and Haiku respectively, both store the locations of file icons in attributes,[8] Haiku's "Mail" service stores all message content and metadata in extended file attributes,[9] 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

[edit]

InFreeBSD 5.0 and later, theUFS1, UFS2, and ZFS filesystems support extended attributes, using theextattr_[10] 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 anull-terminated string, 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 foraccess control lists andmandatory access control.

Linux

[edit]

InLinux, theext2,ext3,ext4,JFS,Squashfs,UBIFS,Yaffs2,ReiserFS,Reiser4,XFS,Btrfs,OrangeFS,Lustre,OCFS2 1.6,ZFS, andF2FS[11] filesystems support extended attributes (abbreviatedxattr) 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 anull-terminated string prefixed by anamespace 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 foraccess control lists. The security namespace is used bySELinux, for example.

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 byBeagle,OpenStack Swift,Dropbox,KDE's semantic metadata framework (Baloo),Chromium,Wget,cURL, andSnapcraft.

The Linux kernel allows extended attributes to have names of up to 255 bytes and values of up to 64 KiB,[15]as doXFS andReiserFS, butext2/3/4 andbtrfs 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 ofsecurity,system,trusted, anduser plus a period. This defines the four namespaces of extended attributes.[16]

Extended attributes can be accessed and modified using thegetfattr andsetfattr commands from theattr package on most distributions.[17] The APIs are calledgetxattr andsetxattr.

macOS

[edit]

Mac OS X 10.4 and later support extended attributes by making use of theHFS+ filesystem Attributes FileB*-tree 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.[citation needed] Any regular file may have a list of extended attributes. HFS+ supports an arbitrary number of named forks, and it is unknown ifmacOS imposes any limit on the number of extended attributes.

Each attribute consists of a name and the associated data. The name is anull-terminatedUnicode string. No namespace restrictions are present (making this anopen xattr system) and the convention is to use a reverse DNS string (similar toUniform 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 thexattr utility.[22]

Since macOS 10.5, files downloaded from theWorld Wide Web are marked withcom.apple.quarantine via extended file attributes.[23] In some older versions of macOS (such asMac OS X 10.6), user space extended attributes were not preserved on save in commonCocoa applications (TextEdit, Preview etc.).[citation needed]

OpenBSD

[edit]

Support for extended file attributes was removed from theOpenBSD source code in 2005 due to a lack of interest inAccess Control Lists.[24]

OS/2

[edit]

InOS/2 version 1.2 and later, theHigh Performance File System was designed with extended attributes in mind, but support for them was also retro-fitted on theFAT 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 moreclusters inside this file. The logical cluster number of the first used cluster is stored inside the owning file's or directory'sdirectory entry.[25] 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 theWorkplace Shell uses several standardized extended attributes (also calledEAs) for purposes like identifying the filetype, comments,computer icons and keywords about the file.Programs written in the interpreted languageRexx store an alreadyparsed version of the code as an extended attribute, to allow faster execution.

Solaris

[edit]

Solaris version 9 and later allows files to have "extended attributes", which are actuallyforks; 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[26] and their ownership and permissions can differ from those of the parent file.

Version 4 of theNetwork File System supports extended attributes in much the same way as Solaris.

Windows NT

[edit]

OnWindows NT, extended attributes with names of up to 255ASCII characters and values of up to 65535 bytes are supported byFAT,[25]HPFS, andNTFS, but without support through theWin32API. This was implemented as part of theOS/2 subsystem. They are notably used by theNFS server of theInterix POSIX subsystem in order to implement Unix-like permissions. TheWindows Subsystem for Linux added in theWindows 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.[27]

Additionally,NTFS can store arbitrary-length extended attributes in the form ofalternate data streams (ADS), a type offork. Plugins for the file managerTotal Commander, likeNTFS Descriptions andQuickSearch eXtended support filtering the file list by or searching for metadata contained in ADS.[28][29]NTFS-3G supports mapping ADS to extended attributes inFUSE; it also maps file attributes that way.[30]

See also

[edit]

References

[edit]
  1. ^xattr(7) – Linux Programmer'sManual – Overview, Conventions and Miscellanea from Manned.org
  2. ^"getea Command".IBMAIX V7.2 documentation.IBM. Retrieved2017-07-11.
  3. ^"getea Subroutine".IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 1. IBM. Retrieved2017-07-11.
  4. ^"setea Subroutine".IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved2017-07-11.
  5. ^"listea Subroutine".IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 1. IBM. Retrieved2017-07-11.
  6. ^"statea Subroutine".IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved2017-07-11.
  7. ^"removeea Subroutine".IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved2017-07-11.
  8. ^"Attributes".Haiku User Guide. Haiku, Inc. Retrieved28 January 2021.
  9. ^"Workshop: Managing Emails".Haiku User Guide. Haiku, Inc. Retrieved28 January 2021.
  10. ^extattr(2) – FreeBSD System CallsManual
  11. ^Kim, Jaegeuk (2012-10-05)."[PATCH 13/16] f2fs: add xattr and acl functionalities". Retrieved2017-07-11.
  12. ^Schaufler, Casey (2002-04-30)."Posix.1e?".Newsgroupcomp.security.unix.
  13. ^"v2.5.3 git commit log". 2002-02-05. Retrieved2017-07-11.
  14. ^"Red Hat Enterprise Linux AS 3 Release Notes (x86 Edition)".Red Hat. 2003. Archived fromthe original on 2017-07-09. Retrieved2017-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.
  15. ^"linux/include/uapi/linux/limits.h". 2012-10-13. Retrieved2017-07-11.
  16. ^xattr(7) – Linux Programmer'sManual – Overview, Conventions and Miscellanea from Manned.org
  17. ^"Commands for Manipulating Filesystem Extended Attributes".GNU Savannah. Retrieved2017-07-11.
  18. ^listxattr(2) – Darwin andmacOS System CallsManual
  19. ^getxattr(2) – Darwin andmacOS System CallsManual
  20. ^setxattr(2) – Darwin andmacOS System CallsManual
  21. ^removexattr(2) – Darwin andmacOS System CallsManual
  22. ^xattr(1) – Darwin andmacOS General CommandsManual
  23. ^"Launch Services Release Notes".developer.apple.com.
  24. ^Dale Rahn (2005-07-03)."CVS log for src/sys/ufs/ufs/Attic/extattr.h".
  25. ^abEager, Bob (2000-10-28)."Implementation of extended attributes on the FAT file system". Retrieved2017-07-11.
  26. ^fsattr(7) – Solaris 11.4 Standards, Environments, Macros, Character Sets, and Miscellany ReferenceManual
  27. ^Hammons, Jack (2016-06-15)."WSL File System Support".MSDN. Retrieved2017-07-11.
  28. ^"NTFS Descriptions 1.2.1".TotalCmd.net. Retrieved16 April 2018.
  29. ^"QuickSearch eXtended".TotalCmd.net. Retrieved16 April 2018.
  30. ^"Extended Attributes".Tuxera. Archived fromthe original on 2020-08-14.
Types
Properties
Organisation
Operations
Linking
Management
Retrieved from "https://en.wikipedia.org/w/index.php?title=Extended_file_attributes&oldid=1330303846"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp