POSIX
约 2 分钟阅读
- POSIX - Portable Operating System Interface
- POSIX.1-2008 - v7
- 2024-06-14 POSIX.1-2024, IEEE Std 1003.1-2024 - v8
- SUS - Single Unix Specification
- 参考
- pubs.opengroup.org/onlinepubs/9799919799
- POSIXWikipediaPOSIXPOSIX - Portable Operating System Interface · POSIX.1-2008 - v7 · 2024-06-14 POSIX.1-2024, IEEE Std 1003.1-2024 - v8 · SUS - Single Unix Specification笔记:POSIX
- What is a POSIX file system?链接www.quobyte.com/storage-explained/posix-filesystemPOSIX - Portable Operating System Interface · POSIX.1-2008 - v7 · 2024-06-14 POSIX.1-2024, IEEE Std 1003.1-2024 - v8 · SUS - Single Unix Specification笔记:POSIX
- 成员 reports.opengroup.org/all.shtml
- POSIX Programmer's Manual
- dirent.h - Directory Entries - 目录项
- unistd.h - Unix Standard - Standard Symbolic Constants and Types - 标准符号常量和类型
struct dirent {
ino_t d_ino; /* Inode编号 */
off_t d_off; /* 不是偏移量,详见下文 */
unsigned short d_reclen; /* 此记录的长度 */
unsigned char d_type; /* 文件类型,不是所有文件系统都支持 */
char d_name[256]; /* 以空字符结尾的文件名 */
};
#define DT_UNKNOWN 0 // Unknown file type
#define DT_FIFO 1 // FIFO (named pipe)
#define DT_CHR 2 // Character device - 字符设备
#define DT_DIR 4 // Directory - 目录
#define DT_BLK 6 // Block device - 块设备
#define DT_REG 8 // Regular file - 文件
#define DT_LNK 10 // Symbolic link - 符号链接
#define DT_SOCK 12 // Socket - 套接字
#define DT_WHT 14 //
int alphasort(const struct dirent **, const struct dirent **);
int closedir(DIR *);
int dirfd(DIR *);
DIR *fdopendir(int);
DIR *opendir(const char *);
ssize_t posix_getdents(int, void *, size_t, int);
struct dirent *readdir(DIR *);
int readdir_r(DIR *restrict, struct dirent *restrict, struct dirent **restrict);
void rewinddir(DIR *);
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
void seekdir(DIR *, long);
long telldir(DIR *);关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub1 条
- bminor/musl/include/dirent.hgithub.com/bminor/musl/blob/master/include/dirent.h
Wikipedia1 条
- POSIXWikipedia:POSIX
其他外链5 条
- pubs.opengroup.org/onlinepubs/9799919799pubs.opengroup.org/onlinepubs/9799919799
- pubs.opengroup.org/onlinepubs/9799919799.2024edition/basedefs/dirent.h.htmlpubs.opengroup.org/onlinepubs/9799919799.2024edition/basedefs/dirent.h.html
- pubs.opengroup.org/onlinepubs/9799919799.2024edition/basedefs/unistd.h.htmlpubs.opengroup.org/onlinepubs/9799919799.2024edition/basedefs/unistd.h.html
- reports.opengroup.org/all.shtmlreports.opengroup.org/all.shtml
- www.quobyte.com/storage-explained/posix-filesystemwww.quobyte.com/storage-explained/posix-filesystem