找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 服务器 Linux/BSD 查看内容

[code]umask function

2009-12-20 13:11| 发布者: admin| 查看: 100| 评论: 0|原作者: 夙瑶

If we try, using either open or creat, to
create a file that already exists, the file's access permission bits are not
changed. We can verify this by running the program from

$ ls -l foo bar check permissions and sizes
--w------- 1 sar 0 Feb 5 14:26 bar
--w------- 1 sar 0 Feb 5 14:26 foo
Note that the permissions didn't change but that the files were
truncated.
perror( "create function failed!" );
}
umask( S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH );
if(creat( "bar" ,RWRWRW )0){
perror( "create 2 function failed " );
}
return 0;
}





最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 13:33 , Processed in 0.157321 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部