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; } |
|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏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.