ACCESS.C
上传用户:qq5388545
上传日期:2022-07-04
资源大小:29849k
文件大小:1k
- #include <stdio.h>
- #include <io.h>
- void main (int argc, char *argv[])
- {
- int access_mode;
- access_mode = access(argv[1], 0);
-
- if (access_mode)
- printf("File %s does not existn");
- else
- {
- access_mode = access(argv[1], 2);
- if (access_mode)
- printf("File cannot be writtenn");
- else
- printf("File can be writtenn");
- access_mode = access(argv[1], 4);
- if (access_mode)
- printf("File cannot be readn");
- else
- printf("File can be readn");
-
- access_mode = access(argv[1], 6);
- if (access_mode)
- printf("File cannot be read/writen");
- else
- printf("File can be read/writen");
- }
- }