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.
This commit is contained in:
wrstuden 1999-08-03 21:43:13 +00:00
parent 3bf14d81e9
commit 0217e4fdc2
2 changed files with 26 additions and 4 deletions

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" from: @(#)strmode.3 8.3 (Berkeley) 7/28/94 .\" 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 .Dd July 28, 1994
.Dt STRMODE 3 .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 .Bl -tag -width flag -offset indent -compact
.It \- .It \-
regular file regular file
.It a
regular file in archive state 1
.It A
regular file in archive state 2
.It b .It b
block special block special
.It c .It c
@ -135,6 +139,14 @@ None of the above apply.
The last character is a plus sign ``+'' if there are any alternative The last character is a plus sign ``+'' if there are any alternative
or additional access control methods associated with the inode, otherwise or additional access control methods associated with the inode, otherwise
it will be a space. 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 .Sh SEE ALSO
.Xr chmod 1 , .Xr chmod 1 ,
.Xr find 1 , .Xr find 1 ,

View File

@ -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 * Copyright (c) 1990, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94"; static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94";
#else #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
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
@ -63,7 +63,17 @@ strmode(mode, p)
*p++ = 'b'; *p++ = 'b';
break; break;
case S_IFREG: /* regular */ case S_IFREG: /* regular */
#ifdef S_ARCH2
if ((mode & S_ARCH2) != 0) {
*p++ = 'A';
} else if ((mode & S_ARCH1) != 0) {
*p++ = 'a';
} else {
#endif
*p++ = '-'; *p++ = '-';
#ifdef S_ARCH2
}
#endif
break; break;
case S_IFLNK: /* symbolic link */ case S_IFLNK: /* symbolic link */
*p++ = 'l'; *p++ = 'l';