POSIX 1003.2B/D9 symbolic links
[unix-history] / usr / src / usr.bin / chflags / chflags.1
index 212ae54..7375133 100644 (file)
@@ -1,12 +1,12 @@
-.\" Copyright (c) 1989, 1990 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1989, 1990, 1993, 1994
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" the Institute of Electrical and Electronics Engineers, Inc.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" the Institute of Electrical and Electronics Engineers, Inc.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)chflags.1   5.4 (Berkeley) %G%
+.\"    @(#)chflags.1   8.2 (Berkeley) %G%
 .\"
 .Dd 
 .Dt CHFLAGS 1
 .\"
 .Dd 
 .Dt CHFLAGS 1
 .Nd change file flags
 .Sh SYNOPSIS
 .Nm chflags
 .Nd change file flags
 .Sh SYNOPSIS
 .Nm chflags
-.Op Fl HRh
+.Oo
+.Fl R
+.Op Fl H | Fl L | Fl P
+.Oc
 .Ar flags
 .Ar file ...
 .Sh DESCRIPTION
 .Ar flags
 .Ar file ...
 .Sh DESCRIPTION
@@ -30,56 +33,63 @@ operand.
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl H
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl H
-When encountering a symbolic link on the command line, follow it.  All other
-symbolic links encountered in the traversal are not followed.
+If the
+.Fl R
+option is specified, symbolic links on the command line are followed.
+(Symbolic links encountered in the tree traversal are not followed.)
+.It Fl L
+If the
+.Fl R
+option is specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is specified, no symbolic links are followed.
 .It Fl R
 .It Fl R
-Traverse a file hierarchy.
-For each file that is of type directory,
-.Nm chflags
-changes the flags of all files in the file hierarchy below it followed
-by the flags of the directory itself.
-.It Fl h
-When encountering a symbolic link anywhere in the traversal, follow it.
+Change the file flags for the file hierarchies rooted
+in the files instead of just the files themselves.
 .El
 .Pp
 .El
 .Pp
-The flags of a symbolic link are immutable, so that unless the
-.Fl h
-or
+Flags are a comma separated list of keywords.
+The following keywords are currently defined:
+.Bd -literal -offset indent compact
+.\"arch        nothing yet.
+dump   set the dump flag
+sappnd set the system append-only flag (super-user only)
+schg   set the system immutable flag (super-user only)
+uappnd set the user append-only flag (owner or super-user only)
+uchg   set the user immutable flag (owner or super-user only)
+.Ed
+.Pp
+Putting the letters
+.Dq no
+before an option causes the flag to be turned off.
+For example:
+.Bd -literal -offset indent compact
+nodump the file should never be dumped
+.Ed
+.Pp
+Symbolic links do not have flags, so unless the
 .Fl H
 .Fl H
-flags are set,
+or
+.Fl L
+option is set,
 .Nm chflags
 .Nm chflags
-on a symbolic link is a no-op.
-.Pp
-Only the owner of a file or the super-user is permitted to change
-the low 16-bits in the flags of a file.
-Only the the super-user is permitted to change
-the high 16-bits in the flags of a file.
+on a symbolic link always succeeds and has no effect.
+The
+.Fl H ,
+.Fl L
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
 .Pp
 The
 .Nm chflags
 utility exits 0 on success, and >0 if an error occurs.
 .Pp
 The
 .Nm chflags
 utility exits 0 on success, and >0 if an error occurs.
-.Sh FLAGS
-Flags may be absolute or symbolic.
-An absolute flag is an octal number constructed by
-.Ar or'ing
-the following values:
-.Pp
-.Bl -tag -width 6n -compact -offset indent
-.It Li 1
-the file should never be dumped
-.El
-.Pp
-The symbolic flags is a comma separated list of keywords.
-The following keywords are defined:
-.Bd -literal -offset indent
-dump         cause the file to be dumped when it is next modified
-.Ed
-.Pp
-Putting the word ``no'' before an option causes it to be deleted.
-For example:
-.Bd -literal -offset indent
-nodump       the file should never be dumped
-.Ed
 .Sh SEE ALSO
 .Xr chflags 2 ,
 .Xr stat 2 ,
 .Sh SEE ALSO
 .Xr chflags 2 ,
 .Xr stat 2 ,