int chmod(const char *pathname, mode_t mode);
int fchmod(int fildes, mode_t mode);
The bits in mode define access permissions for the user associated with the file, the group associated with the file, and all others. The value of mode is the bitwise inclusive-or of one of the access permissions to be checked.
When successfully completed, these functions mark the st_ctime field of the file for update.
Points to the name of the file.
Is the file descriptor of an open file.
Is a bitwise-or field that specifies the new permission modes for path name.
Search permission is denied on a component of pathname.
fildes is not a valid file descriptor.
pathname points outside the allocated address space of the process.
A signal interrupted the call.
An I/O error occurred while reading from or writing to the file system.
The value of the mode argument is invalid.
The length of the pathname parameter exceeds PATH_MAX or a pathname component is longer than NAME_MAX while _POSIX_NO_TRUNC is in effect.
The named file does not exist or the pathname parameter points to an empty string.
A component of the pathname prefix is not a directory.
The effective user ID does not match the owner of the file and the calling process does not have the appropriate privileges.
POSIX.1 (1996), with exceptions.
Windows file systems have a set of DOS attribute bits. One of these bits is for the read-only status of a file. On file systems other than NTFS, these functions set the read-only attribute bit if no write-enable bit is specified in mode. Otherwise, the read-only attribute bit is cleared. For NTFS, the read-only attribute bit is set if no write-enable bit is set in the Access Control List for the file, and cleared otherwise.
There are differences in how the NuTCRACKER Platform uses some of the bits in mode, compared to the referenced standard. Refer to the struct stat page, to File Management in the Windows Concepts chapter of the PTC MKS Toolkit UNIX to Windows Porting Guide, and also Security in the API-Specific Porting Issues chapter of the PTC MKS Toolkit UNIX to Windows Porting Guide.
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
- struct stat
PTC MKS Toolkit 10.2 Documentation Build 28.