调用stat (、fstat )、lstat )等函数时,必须包含包含要使用的数据类型、结构类型的#include头文件。 例如:
dev _ tst _ devidofdevicecontainingfile
ino _ t ST _ ino文件序列编号
mode _ tst _ modemodeoffile (see below ) )。
nlink _ tst _ nlinknumberoflinkstothefile
uid_t st_uid user ID of file
gid_t st_gid group ID of file
dev _ tst _ rdev设备id (iffileischaracterorblockspecial ) )。
off _ tst _ sizefilesizeinbytes (iffileisaregularfile ) ) ) ) ) ) ) ) )。
time_t st_atime time of last access
time _ tst _ mtimetimeoflastdatamodification
time _ tst _ ctimetimeoflaststatuschange
用法:包含头文件:
#包含
#包含
在程序中,可以根据需要调用以下函数: 以下是函数的原型
int chmod (常数char *,mode_t );
intfchmod(int,mode_t );
intfstat(int,结构状态*;
intlstat(constchar*,struct stat *;
int mkdir (常数char *,mode_t );
int mkfifo (常数char *,mode_t );
intmknod(constchar*,mode_t,dev_t );
intstat(constchar*,struct stat *;
int main () )。
具体的调用语句和程序可以写在这里
}