Linux的include作用,include的用法结构

调用 stat(),fstat(), lstat(), 等函数时,需要包含 #include 头文件,它包含了要用到一些数据类型,结构类型。例如:

dev_t st_dev ID of device containing file

ino_t st_ino file serial number

mode_t st_mode mode 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_rdev device ID (if file is character or block special)

off_t st_size file size in bytes (if file is a regular file)

time_t st_atime time of last access

time_t st_mtime time of last data modification

time_t st_ctime time of last status change

用法:包含头文件:

#include

#include

程序里,需要时可调用下列函数,下面是函数原型

int chmod(const char *, mode_t);

int fchmod(int, mode_t);

int fstat(int, struct stat *);

int lstat(const char *, struct stat *);

int mkdir(const char *, mode_t);

int mkfifo(const char *, mode_t);

int mknod(const char *, mode_t, dev_t);

int stat(const char *, struct stat *);

int main(){

具体的调用语句和程序可写在这里

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值