setmode()

set file permission mode 

Function


SYNOPSIS

#include <unistd.h>

void * setmode(const char *p);


DESCRIPTION

The setmode() function takes p, a null-terminated string describing file access permissions, and returns a pointer to file permission mode values that can be used by getmode(). For some symbolic file permission names, setmode() examines the file creation mask. If the calling program changes the value of its file creation mask after calling setmode(), setmode() must be called again if getmode() is to modify future file modes correctly.


PARAMETERS

p 

Points to a null-terminated ASCII string of either octal digits or a symbolic name that specifies a file permission mode. This string has the same format as the permission argument to the UNIX shell command chmod. Absolute permission specifiers are strings of octal digits. For example, the value 0644 indicates that the file owner has read/write permission, but others only have read permission.

Symbolic names for file access permissions consist of a comma-separated list of elements in the form:

<who><what><permissions>

where <who> is u, g, o, or a, <what> is either - or +, and <permissions> are r, w, or x.

For example, the symbolic representation for adding write permission to group members is g+w.


RETURN VALUES

A file permission mode value that can be used by getmode(). If string p is not a recognizable file permission mode, setmode() returns a NULL pointer.


CONFORMANCE

4.4BSD.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
chmod(), getmode(), umask()


PTC MKS Toolkit 10.4 Documentation Build 39.