文件的权限属性

文件的权限属性
文本模式#include stdio.h #include sys/types.h //open函数的3个头文件 #include sys/stat.h #include fcntl.h #include unistd.h //close函数的头文件 //int open(const char *pathname, intflags); //int open(const char *pathname, intflags, mode_tmode); int main() { int fd; //fold describe fd open(mm,O_RDWR|O_CREAT); //0755 if(fd -1) { printf(open failed!\n); perror(why); return -1; } printf(open succeed!\n); close fd return 0; }命令行模式man 2 open vim demo1.c gcc demo1.c -o demo ./demo ls -l