Книги автора: Programming with POSIX® Threads
/ Книги автора: Programming with POSIX® Threads
Книга: Programming with POSIX® Threads
6.5.2 Directory searching
6.5.2 Directory searching
int readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result);
This function performs essentially the same action as readdir. That is, it returns the next directory entry in the directory stream specified by dirp. The difference is that instead of returning a pointer to that entry, it copies the entry into the buffer specified by entry. On success, it returns 0 and sets the pointer specified by result to the buffer entry. On reaching the end of the directory stream, it returns 0 and sets result to NULL. On failure, it returns an error number such as
EBADF.
Refer to program pipe .c, in Section 4.1, for a demonstration of using readdir_r to allow your threads to search multiple directories concurrently.
Похожие страницы
- EXTERNAL FUNCTION DIRECTORY
- Безопасность внешних таблиц. Параметр EXTERNAL FILE DIRECTORY
- ТМР DIRECTORY
- 5.1.2. The Directory Server Interface
- Directory Permissions
- Initializing the Data Directory in PostgreSQL
- Populating Your Directory
- Searching with Beagle
- Finding Files by Searching with find
- Listing Files in the Current Directory with ls
- 4.2.1. Top-Level Source Directory
- 4.2.5. Subdirectory Layout