lchown专题

APUE-文件和目录(三)函数chown 和lchown

下面的几个chown函数可用于更改文件的用户ID和组ID。如果两个参数owner或group中的任意一个是-1,则对应的ID不变。 #include<unistd.h>int chown(const char *pathname,uid_t owner,gid_t group);int fchown(int fd,uid_t owner,gid_t group);int fchownat