对每个命令行参数打印文件类型
时间:2010-12-24 来源:longmenyu
1.stat,fstat,lstat函数返回文件有关的信息结构;
2.lstat函数类似于stat,但是当命名的文件时一个符号链接时,lstat返回该符号链接有关的信息,而不是由该符号链接引用文件的信息;
程序清单:
#include <stdio.h> //for printf |
obe-240 test/linuxc> gcc -o stat_test stat_test4.c
obe-240 test/linuxc> ./stat_test /etc /etc/passwd /dev /dev/log /dev/tty \
? /dev/cdrom
argv[1]:/etc: directory
argv[2]:/etc/passwd: regular
argv[3]:/dev: directory
argv[4]:/dev/log: socket
argv[5]:/dev/tty: character special
argv[6]:/dev/cdrom: symbolic link
- 系统休眠文件删除后果 如何删除计算机的休眠文件 2025-04-22
- 站群服务器是什么意思 站群服务器的作用 站群服务器和普通服务器的区别 2025-04-22
- jQuery插件有何作用 jQuery插件的使用方法 2025-04-22
- jQuery插件有哪些种类 简单的jQuery插件实例 2025-04-22
-