#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
int main(int argc, char** argv)
{
int fd;
fd = open("testdir", O_CREAT, 555);
if(fd != -1)
fchmod(fd, 422);
else
printf("cannot open the directory \n");
return 0;
}
No comments:
Post a Comment