[cs631apue] file archive state

Jan Schaumann jschauma at stevens.edu
Mon Oct 15 16:38:46 EDT 2012


yluo4 <yluo4 at stevens.edu> wrote:

>   I have a couple of questions. You have said that using strmode to  
> identify archive state.  When I saw the manual of strmode, I didn't see  
> the archive state type.

Correct - strmode(3) can only identify what is supported on the system
it is running on.  Linux does not know of or use file archive modes, so
strmode(3) on that platform cannot identify it.

The good news is that you don't have to worry about it, precisely
because strmode(3) will do the right thing.  That is, if the platform
you were running your progam on did support these types of files, your
program would print the right character.

> By the way, what are exact  archive state 1 and archive state 2?

The archive bit is used for compatibility with certain file systems
(such as Windows' file system).  A file in archive state 1 has been
modified since the last full backup; an archive state 2 has been
modified since the last incremental backup.  The backup program clears
the archive flag when it backs up the file.

See http://www.netadmintools.com/art399.html for details.

> I  have another question about '-F'.  I have found that I can use
> strmode  to identify 'whiteout'. But I don't figure out how to
> identify pathname  that is executable.

The executable bit for the given user, group or other must be set; you
can individually test this by operating on the st_mode field (S_IXUSR,
S_IXGRP, S_IXOTH).  strmode(3) will do the right thing for you here,
too.

-Jan


More information about the cs631apue mailing list