⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 director.3

📁 操作系统设计与实现源码
💻 3
字号:
.TH DIRECTORY 3.SH NAMEdirectory, opendir, readdir, rewinddir, closedir, telldir, seekdir \- directory routines.SH SYNOPSIS.nf.ft B#include <sys/types.h>#include <dirent.h>DIR *opendir(const char *\fIdirname\fP)struct dirent *readdir(DIR *\fIdirp\fP)void rewinddir(DIR *\fIdirp\fP)int closedir(DIR *\fIdirp\fP)#define _MINIX  1#include <sys/types.h>#include <dirent.h>long telldir(DIR *\fIdirp\fP)int seekdir(DIR *\fIdirp\fP, long \fIpos\fP).SH DESCRIPTIONThese routines form a system independent interface to access directories..PP.B Opendir()opens the directory.I dirnameand returns a pointer to this open directory stream..PP.B Readdir()reads one entry from the directory as a pointer to a structure containingthe field.BR d_name ,a character array containing the null-terminated name of the entry..PP.B Rewinddir()allows the directory to be read again from the beginning..PP.B Closedir()closes the directory and releases administrative data..PPThe Minix specific functions.B telldir()and.B seekdir()allow one to get the current position in the directory file and to returnthere later..B Seekdir()may only be called with a position returned by.B telldir()or 0 (rewind).  These functions should not be used in portable programs..SH "SEE ALSO".BR dir (5)..SH DIAGNOSTICS.B Opendir()returns a null pointer if.I dirnamecan't be opened, or if it can't allocate enough memory for the.B DIRstructure..PP.B Readdir()returns null if there are no more directory entries or on error..PP.B Closedir()and.B seekdir()returns 0 on success, -1 on error..PP.B Telldir()returns -1 on error..PPAll of them set.B errnoappropriately..B Readdir()will only set.B errnoon error, not on end-of-dir, so you should set.B errnoto zero beforehand, and check its value if.B readdir()returns null..SH NOTESThe return value of.B readdir()needs to be copied before the next operation on the same directory if it isto be saved..SH AUTHORKees J. Bot (kjb@cs.vu.nl)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -