dev_t st_dev ID of device containing file
ino_t st_ino file serial number
mode_tst_modemode of file (see below)
nlink_t st_nlink number of links to the file
uid_t st_uid user ID of file
gid_t st_gid group ID of file
dev_t st_rdevdevice ID (if file is character or block special)
off_t st_sizefile size in bytes (if file is a regular file)
time_tst_atime time of last access
time_tst_mtime time of last data modification
time_tst_ctime time of last status change
用法:包含头文件:
#include <sys/types.h>
#include <sys/stat.h>
程序里,需要时可调用下列函数,下面是函数原型
intchmod(const char *, mode_t)
intfchmod(int, mode_t)
intfstat(int, struct stat *)
intlstat(const char *, struct stat *)
intmkdir(const char *, mode_t)
intmkfifo(const char *, mode_t)
intmknod(const char *, mode_t, dev_t)
intstat(const char *, struct stat *)
int main(){
具体的调用语句和程序可写在这里
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)