Linux下的struct dirent
来源:互联网 发布:山东财经大学网络自 编辑:程序博客网 时间:2024/05/06 16:24
#include <dirent.h>
struct dirent
{
long d_ino; /* inode number 索引节点号 */
off_t d_off; /* offset to this dirent 在目录文件中的偏移 */
unsigned short d_reclen; /* length of this d_name 文件名长 */
unsigned char d_type; /* the type of d_name 文件类型 */
char d_name [NAME_MAX+1]; /* file name (null-terminated) 文件名,最长255字符 */
}
{
long d_ino; /* inode number 索引节点号 */
off_t d_off; /* offset to this dirent 在目录文件中的偏移 */
unsigned short d_reclen; /* length of this d_name 文件名长 */
unsigned char d_type; /* the type of d_name 文件类型 */
char d_name [NAME_MAX+1]; /* file name (null-terminated) 文件名,最长255字符 */
}
d_type 的值包括:
enum
{
DT_UNKNOWN = 0,
# define DT_UNKNOWN DT_UNKNOWN //未知类型
DT_FIFO = 1,
# define DT_FIFO DT_FIFO // 命名管道
DT_CHR = 2,
# define DT_CHR DT_CHR //字符设备文件
DT_DIR = 4,
# define DT_DIR DT_DIR //目录文件
DT_BLK = 6,
# define DT_BLK DT_BLK 块设备文件
DT_REG = 8,
# define DT_REG DT_REG //普通文件
DT_LNK = 10,
# define DT_LNK DT_LNK //连接
DT_SOCK = 12,
# define DT_SOCK DT_SOCK //本地套接口
DT_WHT = 14
# define DT_WHT DT_WHT //whiteout
};
{
DT_UNKNOWN = 0,
# define DT_UNKNOWN DT_UNKNOWN //未知类型
DT_FIFO = 1,
# define DT_FIFO DT_FIFO // 命名管道
DT_CHR = 2,
# define DT_CHR DT_CHR //字符设备文件
DT_DIR = 4,
# define DT_DIR DT_DIR //目录文件
DT_BLK = 6,
# define DT_BLK DT_BLK 块设备文件
DT_REG = 8,
# define DT_REG DT_REG //普通文件
DT_LNK = 10,
# define DT_LNK DT_LNK //连接
DT_SOCK = 12,
# define DT_SOCK DT_SOCK //本地套接口
DT_WHT = 14
# define DT_WHT DT_WHT //whiteout
};
- Linux下的struct dirent
- Linux下struct dirent,DIR,struct stat使用例子
- linux下的DIR,dirent,stat
- struct dirent
- struct dirent
- struct dirent的char d_name[1]成员
- Linux下的DIR,dirent,stat等结构体详解
- vs2005下的dirent.h
- vs2005下的dirent.h
- vs2005下的dirent.h
- struct dirent成员
- struct dirent和DIR
- AIX:struct dirent d_type
- linux 系统获得当前文件夹下存在的所有文件 scandir函数和struct dirent **namelist结构体
- Linux下DIR,dirent,stat 结构体
- linux下的struct sigaction
- windows下MSVC兼容的dirent.h
- file属性读取 Struct dirent struct stat
- linux tar.gz 安装方法
- Eclipse、MyEclipse优化,提高运行速度
- CentOS 6.4 i386的学习笔记-001 自定义安装图形界面
- Communications link failure错误分析<转>
- Python
- Linux下的struct dirent
- nginx安装指南
- android基础学习(11)-------尺寸、样式
- 分析ANR或者系统内存崩溃的问题
- Java实现视频网站的视频上传、视频转码、视频关键帧抽图, 及视频播放功能
- 网络流量相关
- Oracle自增主键
- hdu 3794 Magic Coupon
- HTTP 返回状态值