int chown(const char *pathname, uid_t owner, gid_t group);
int fchown(int fildes, uid_t owner, gid_t group);
int lchown(const char *pathname, uid_t owner, gid_t group);
When successfully completed, these functions mark the st_ctime field of the file for update.
If the owner or group is specified as (uid_t)-1 or (gid_t)-1 respectively, the corresponding ID of the file is unchanged.
Points to the path name of the file to modify.
Is the file descriptor of an open file.
Is the new user ID for the file.
Is the new group ID for the file.
Search permission is denied on a component of the path name prefix of pathname.
fildes is not a valid file descriptor.
pathname points outside the allocated address space of the process.
A signal interrupted the call.
group or owner is invalid.
An I/O error occurred while reading from or writing to the file system.
The length of pathname exceeds PATH_MAX or a path name component is longer than NAME_MAX while _POSIX_NO_TRUNC is in effect.
Either a component of the pathname prefix or the file that pathname refers to does not exist or is a null path name.
A component of the path name prefix of pathname refers is not a directory.
The effective user ID does not match the owner of the file or the calling process does not have appropriate privileges.
There are differences in how the NuTCRACKER Platform handles file ownership, 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.
Windows does not currently support symbolic links, so
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.3 Documentation Build 39.