作业:用open创建一个0777的普通文件
#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
int main(int argc, const char *argv[])
{
intfd=open("./creat.txt",O_RDWR|O_CREAT|O_TRUNC,0777);
printf("fd=%d",fd);
return0;
}
//umask码原值为0002;
ubuntu@ubuntu:~/io/io2$ umask
0002
//临时修改umask码值为0000
ubuntu@ubuntu:~/io/io2$ umask 0000
