码迷,mamicode.com
首页 > 其他好文 > 详细

stat,fstat,lstat三者区别

时间:2016-03-03 21:08:36      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

fstat ,lstat,stat;

头文件:#include<sys/stat.h>

    #include<sys/types.h>

    #include<unistd.h>

定义函数:

(1)int stat(const char *file_name,struct stat *buf)

返回一个与此命名文件有关的信息结构

(2)int fstat(int fileds,struct stat *buf)

获得已在文件描述符filedes上打开的文件的相关信息

(3)int fstat(const char *path_name,struct stat *buf)

类似stat,当命名的文件是符号链接时,返回该符号链接的相关信息

 

stat,fstat,lstat三者区别

标签:

原文地址:http://www.cnblogs.com/defen/p/5239727.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!