stat函数 ,fstat,lstat函数(UNIX)
关于Stat函数详解:
头文件:
#include <sys/stat.h>
#include <unistd.h>
int stat(const char *file_name, struct stat *buf);
通过文件名filename获取文件信息,并保存在buf所指的结构体stat中
返回值: 执行成功则返回0,失败返回-1,错误代码存于errno
struct stat {
dev_t st_dev; //文件的设...
原创
2022-03-07 23:32:41 ·
352 阅读 ·
0 评论