chmod.c
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 25 行
C
25 行
/*
* change the permissions of a list of files
* to be read/write by the owner only
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <io.h>
void main( int argc, char *argv[] )
{
int i;
int ecode = 0;
for( i = 1; i < argc; i++ ) {
if( chmod( argv[i], S_IRUSR | S_IWUSR ) == -1 ) {
perror( argv[i] );
ecode++;
}
}
exit( ecode );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?