- ÂÛ̳»ÕÕÂ:
- 0
|
Ϊʲôumask()ʧЧ£¿
#include <sys/types.h>;
#include <sys/stat.h>;
#include <fcntl.h>;
#include "ourhdr.h"
int main( void)
{
umask(0);
if (creat("foo",S_IRUSR | S_IWUSR |
S_IRGRP | S_IWGRP |
S_IROTH ) <0 )
printf ("create error for foo \n"
umask(S_IRGRP | S_IWGRP | S_IXGRP |#ÕâÀïÒÑÆÁ±ÎÁË×éµÄ read and write and run
S_IROTH | S_IWOTH | S_IXOTH);
if (creat("bar",S_IRUSR | S_IWUSR |
S_IRGRP | S_IWGRP ) <0 )
printf( "create error for bar \n"
exit (0);
}
# ls -l foo bar
-rw------- 1 root root 0 2003-12-20 04:12 bar
-rw-rw-r-- 1 root root 0 2003-12-20 04:12 foo
Ó¦¸ÃÊÇ´´½¨bar³ö´íµÄ£¬ÎªÊ²Ã´ÄÜ´´½¨barÎļþ£¿
help me !!thanks in advance!! |
|