delorie.com/djgpp/doc/libc/libc_94.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <sys/stat.h> int chmod(const char *path, mode_t mode); |
This function changes the mode (writable or write-only) of the specified file. The value of mode can be a combination of one or more of the following:
S_IRUSR
Make the file readable for the owner.
S_IWUSR
Make the file writable for the owner.
S_IRGRP
Make the file readable for the group.
S_IWGRP
Make the file writeable for the group.
S_IROTH
Make the file readable for the world.
S_IWOTH
Make the file writeable for the world.
Some S_I*
constants are ignored for regular files:
S_I*GRP
and S_I*OTH
are ignored, because DOS/Windows
has no concept of ownership, so all files are considered to belong
to the user;
S_IR*
are ignored, because files are always readable on DOS/Windows.
This function can be hooked by File System Extensions (see section File System Extensions).
Zero if the file exists and the mode was changed, else nonzero.
ANSI/ISO C | No |
POSIX | 1003.2-1992; 1003.1-2001 |
chmod("/tmp/dj.dat", S_IWUSR|S_IRUSR); |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |