Home Man
Today's Posts

Linux & Unix Commands - Search Man Pages

NetBSD 6.1.5 - man page for string_to_flags (netbsd section 3)

STAT_FLAGS(3)			   BSD Library Functions Manual 		    STAT_FLAGS(3)

     string_to_flags, flags_to_string -- Stat flags parsing and printing functions

     System Utilities Library (libutil, -lutil)

     #include <util.h>

     char *
     flags_to_string(u_long flags, const char *def);

     string_to_flags(char **stringp, u_long *setp, u_long clrp);

     The flags_to_string() and string_to_flags() functions are used by programs such as ls(1),
     mtree(8), makefs(8), etc., to parse and/or print the st_flags field in the stat(2) struc-

     They recognize the following flags:

	   String     Flag	      Description
	   arch       SF_ARCHIVED     file is archived
	   nodump     UF_NODUMP       do not dump file
	   opaque     UF_OPAQUE       directory is opaque in union filesystems
	   sappnd     SF_APPEND       writes to the file may only append
	   schg       SF_IMMUTABLE    file cannot be changed; it is immutable
	   snap       SF_SNAPSHOT     file is a snapshot inode
	   uappnd     UF_APPEND       writes to the file may only append
	   uchg       UF_IMMUTABLE    file cannot be changed; it is immutable

     The SF_APPEND and SF_IMMUTABLE flags are for the superuser only, whereas UF_APPEND and
     UF_IMMUTABLE are for the user only.

     The flags_to_string() function converts the bits set in the flags argument to a comma-sepa-
     rated string and returns it.  If no flags are set, then the def string is returned.  The
     returned string is allocated via malloc(3) and it is the responsibility of the caller to
     free(3) it.

     The string_to_flags() function takes a stringp of space, comma, or tab separated flag names
     and places their bit value on the setp argument.  If the flag name is prefixed by: ``no'',
     then the bit value is placed on the clrp argument.

     flags_to_string() returns the symbolic representation of flags, the default string, or NULL
     if allocation failed.

     string_to_flags() returns 0 on success and 1 if it fails to parse the string, setting
     stringp to point to the first string that it failed to parse.

     chflags(2), stat(2)

BSD					  August 6, 2011				      BSD

All times are GMT -4. The time now is 05:21 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password