时间:2021-01-14 11:13:34 | 栏目:Shell | 点击:次
mode = atoi(argv[1]);
if(mode>777||mode<0)
{
printf("mode num error");
exit(0);
}
mode_u = mode/100;
mode_g = (mode- mode_u*100)/10;
mode_o = mode -mode_u*100-mode_g*10;
mode = mode_u*8*8+mode_g*8+mode_o;
path = argv[2];
if(chmod(path,mode)==-1)
{
perror("chmod error");
exit(1);
}
return 0;
}