chmod 三个八进制数字 文件名
int mkdir(char *pathname, mode_t mode);
1 int main() 2 { 3 char *path="/root/tmp11"; 4 if(mkdir(path, 0754)==0) /*权限设置参数,第一个0表明八进制数,754含义同上;若是建立成功,返回0*/
5 { 6 printf("created the directory %s. \n", path); 7 } 8 else
9 { 10 printf("error\n"); 11 } 12 return 0; 13 }
int rmdir(char *pathname);
rm -rf pathname
int creat(char *pathname, mode_t mode);/*成功时返回建立文件的句柄,不然返回-1*/
int remove(char *pathname);
int flock(int fd, int operation); /*文件锁定成功时返回0,不然返回-1*/