diff options
| author | wrstuden <wrstuden@NetBSD.org> | 1999-08-03 21:43:13 +0000 |
|---|---|---|
| committer | wrstuden <wrstuden@NetBSD.org> | 1999-08-03 21:43:13 +0000 |
| commit | 0217e4fdc264e7b416d0769dadd1401cce55f2a2 (patch) | |
| tree | cc0aa5bd26813f644d5e68dc020030bd66ffeb11 /lib/libc/string | |
| parent | 3bf14d81e9bd465d35ac4ce0fa873d9de0c9bae8 (diff) | |
Add and document support for using new archive state mode flags. Now
archived files will show up as either "a" (S_ARCH1) or "A" (S_ARCH2)
in ls -l. As noted, archive state is fs-dependent, and not maintained
by most fs's.
Diffstat (limited to 'lib/libc/string')
| -rw-r--r-- | lib/libc/string/strmode.3 | 14 | ||||
| -rw-r--r-- | lib/libc/string/strmode.c | 16 |
2 files changed, 26 insertions, 4 deletions
diff --git a/lib/libc/string/strmode.3 b/lib/libc/string/strmode.3 index 8193bf491f7..87e3cd835c3 100644 --- a/lib/libc/string/strmode.3 +++ b/lib/libc/string/strmode.3 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)strmode.3 8.3 (Berkeley) 7/28/94 -.\" $NetBSD: strmode.3,v 1.9 1998/02/05 18:50:53 perry Exp $ +.\" $NetBSD: strmode.3,v 1.10 1999/08/03 21:43:13 wrstuden Exp $ .\" .Dd July 28, 1994 .Dt STRMODE 3 @@ -62,6 +62,10 @@ The first character is the inode type, and will be one of the following: .Bl -tag -width flag -offset indent -compact .It \- regular file +.It a +regular file in archive state 1 +.It A +regular file in archive state 2 .It b block special .It c @@ -135,6 +139,14 @@ None of the above apply. The last character is a plus sign ``+'' if there are any alternative or additional access control methods associated with the inode, otherwise it will be a space. +.Pp +Archive state 1 and archive state 2 represent file system dependent +archive state for a file. Most file systems do not retain file archive +state, and so will not report files in either archive state. +msdosfs will report a file in archive state 1 if it has been +archived more recently than modified. Hierarchical storage systems +may have multiple archive states for a file and may define archive +states 1 and 2 as appropriate. .Sh SEE ALSO .Xr chmod 1 , .Xr find 1 , diff --git a/lib/libc/string/strmode.c b/lib/libc/string/strmode.c index f8a24bf63b3..5a6dac46743 100644 --- a/lib/libc/string/strmode.c +++ b/lib/libc/string/strmode.c @@ -1,4 +1,4 @@ -/* $NetBSD: strmode.c,v 1.8 1998/02/03 18:49:20 perry Exp $ */ +/* $NetBSD: strmode.c,v 1.9 1999/08/03 21:43:13 wrstuden Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94"; #else -__RCSID("$NetBSD: strmode.c,v 1.8 1998/02/03 18:49:20 perry Exp $"); +__RCSID("$NetBSD: strmode.c,v 1.9 1999/08/03 21:43:13 wrstuden Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -63,7 +63,17 @@ strmode(mode, p) *p++ = 'b'; break; case S_IFREG: /* regular */ - *p++ = '-'; +#ifdef S_ARCH2 + if ((mode & S_ARCH2) != 0) { + *p++ = 'A'; + } else if ((mode & S_ARCH1) != 0) { + *p++ = 'a'; + } else { +#endif + *p++ = '-'; +#ifdef S_ARCH2 + } +#endif break; case S_IFLNK: /* symbolic link */ *p++ = 'l'; |
