diff options
author | Kenneth D. Merry <ken@FreeBSD.org> | 2013-08-21 23:04:48 +0000 |
---|---|---|
committer | Kenneth D. Merry <ken@FreeBSD.org> | 2013-08-21 23:04:48 +0000 |
commit | 7da1a731c63c3b15d6dcbc57ad27567cb4a1f043 (patch) | |
tree | d1d973ff655e6ac9fe574c3a73ba81412ceab79f /lib | |
parent | 46be218dce25ebb5739446f6bc9a453f3593186f (diff) | |
download | src-7da1a731c63c3b15d6dcbc57ad27567cb4a1f043.tar.gz src-7da1a731c63c3b15d6dcbc57ad27567cb4a1f043.zip |
Notes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/strtofflags.c | 20 | ||||
-rw-r--r-- | lib/libc/sys/chflags.2 | 66 |
2 files changed, 72 insertions, 14 deletions
diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c index 1edaa5a91154..55e99451b13d 100644 --- a/lib/libc/gen/strtofflags.c +++ b/lib/libc/gen/strtofflags.c @@ -62,13 +62,29 @@ static struct { #endif { "nouappnd", 0, UF_APPEND }, { "nouappend", 0, UF_APPEND }, + { "nouarch", 0, UF_ARCHIVE }, + { "nouarchive", 0, UF_ARCHIVE }, + { "nohidden", 0, UF_HIDDEN }, + { "nouhidden", 0, UF_HIDDEN }, { "nouchg", 0, UF_IMMUTABLE }, { "nouchange", 0, UF_IMMUTABLE }, { "nouimmutable", 0, UF_IMMUTABLE }, { "nodump", 1, UF_NODUMP }, - { "noopaque", 0, UF_OPAQUE }, { "nouunlnk", 0, UF_NOUNLINK }, - { "nouunlink", 0, UF_NOUNLINK } + { "nouunlink", 0, UF_NOUNLINK }, + { "nooffline", 0, UF_OFFLINE }, + { "nouoffline", 0, UF_OFFLINE }, + { "noopaque", 0, UF_OPAQUE }, + { "nordonly", 0, UF_READONLY }, + { "nourdonly", 0, UF_READONLY }, + { "noreadonly", 0, UF_READONLY }, + { "noureadonly", 0, UF_READONLY }, + { "noreparse", 0, UF_REPARSE }, + { "noureparse", 0, UF_REPARSE }, + { "nosparse", 0, UF_SPARSE }, + { "nousparse", 0, UF_SPARSE }, + { "nosystem", 0, UF_SYSTEM }, + { "nousystem", 0, UF_SYSTEM } }; #define nmappings (sizeof(mapping) / sizeof(mapping[0])) diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index 5bc2ba225e6c..9cca54f7c876 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -112,26 +112,61 @@ The flags specified are formed by the following values .Pp .Bl -tag -width ".Dv SF_IMMUTABLE" -compact -offset indent -.It Dv UF_NODUMP -Do not dump the file. -.It Dv UF_IMMUTABLE -The file may not be changed. -.It Dv UF_APPEND +.It Dv SF_APPEND The file may only be appended to. -.It Dv UF_NOUNLINK -The file may not be renamed or deleted. -.It Dv UF_OPAQUE -The directory is opaque when viewed through a union stack. .It Dv SF_ARCHIVED -The file may be archived. +The file has been archived. +This flag means the opposite of the DOS, Windows and CIFS +FILE_ATTRIBUTE_ARCHIVE attribute. +This flag has been deprecated, and may be removed in a future release. .It Dv SF_IMMUTABLE The file may not be changed. -.It Dv SF_APPEND -The file may only be appended to. .It Dv SF_NOUNLINK The file may not be renamed or deleted. .It Dv SF_SNAPSHOT The file is a snapshot file. +.It Dv UF_APPEND +The file may only be appended to. +.It Dv UF_ARCHIVE +The file needs to be archived. +This flag has the same meaning as the DOS, Windows and CIFS +FILE_ATTRIBUTE_ARCHIVE attribute. +Filesystems in FreeBSD may or may not have special handling for this flag. +For instance, ZFS tracks changes to files and will set this bit when a +file is updated. +UFS only stores the flag, and relies on the application to change it when +needed. +.It Dv UF_HIDDEN +The file may be hidden from directory listings at the application's +discretion. +The file has the DOS, Windows and CIFS FILE_ATTRIBUTE_HIDDEN attribute. +.It Dv UF_IMMUTABLE +The file may not be changed. +.It Dv UF_NODUMP +Do not dump the file. +.It Dv UF_NOUNLINK +The file may not be renamed or deleted. +.It Dv UF_OFFLINE +The file is offline, or has the Windows and CIFS FILE_ATTRIBUTE_OFFLINE +attribute. +Filesystems in FreeBSD store and display this flag, but do not provide any +special handling when it is set. +.It Dv UF_OPAQUE +The directory is opaque when viewed through a union stack. +.It Dv UF_READONLY +The file is read only, and may not be written or appended. +Filesystems may use this flag to maintain compatibility with the DOS, Windows +and CIFS FILE_ATTRIBUTE_READONLY attribute. +.It Dv UF_REPARSE +The file contains a Windows reparse point and has the Windows and CIFS +FILE_ATTRIBUTE_REPARSE_POINT attribute. +.It Dv UF_SPARSE +The file has the Windows FILE_ATTRIBUTE_SPARSE_FILE attribute. +This may also be used by a filesystem to indicate a sparse file. +.It Dv UF_SYSTEM +The file has the DOS, Windows and CIFS FILE_ATTRIBUTE_SYSTEM attribute. +Filesystems in FreeBSD may store and display this flag, but do not provide +any special handling when it is set. .El .Pp If one of @@ -162,6 +197,13 @@ the system is in single-user mode. .Xr init 8 for details.) .Pp +The implementation of all flags is filesystem-dependent. +See the description of the +.Dv UF_ARCHIVE +flag above for one example of the differences in behavior. +Care should be exercised when writing applications to account for +support or lack of support of these flags in various filesystems. +.Pp The .Dv SF_SNAPSHOT flag is maintained by the system and cannot be toggled. |