dirent.h(3HEAD) Headers dirent.h(3HEAD)NAME
dirent.h, dirent - format of directory entries
SYNOPSIS
#include <dirent.h>
DESCRIPTION
The internal format of directories is unspecified. The <dirent.h> header defines the following type:
DIR A type representing a directory stream.
The header also defines the structure dirent, which includes the following members:
ino_t d_ino /* file serial number */
char d_name[] /* name of entry */
The type ino_t is defined as described in <sys/types.h>. See types(3HEAD).
The character array d_name is of unspecified size, but the number of bytes preceding the terminating null byte must not exceed {NAME_MAX}.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO closedir(3C), opendir(3C), readdir(3C), rewinddir(3C), seekdir(3C), telldir(3C), types.h(3HEAD), attributes(5), standards(5)SunOS 5.11 10 Sep 2004 dirent.h(3HEAD)
Check Out this Related Man Page
dirent.h(3HEAD) Headers dirent.h(3HEAD)NAME
dirent.h, dirent - format of directory entries
SYNOPSIS
#include <dirent.h>
DESCRIPTION
The internal format of directories is unspecified. The <dirent.h> header defines the following type:
DIR A type representing a directory stream.
The header also defines the structure dirent, which includes the following members:
ino_t d_ino /* file serial number */
char d_name[] /* name of entry */
The type ino_t is defined as described in <sys/types.h>. See types(3HEAD).
The character array d_name is of unspecified size, but the number of bytes preceding the terminating null byte must not exceed {NAME_MAX}.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO closedir(3C), opendir(3C), readdir(3C), rewinddir(3C), seekdir(3C), telldir(3C), types.h(3HEAD), attributes(5), standards(5)SunOS 5.10 10 Sep 2004 dirent.h(3HEAD)
hi...do opendir/readdir/closedir work also in windows platform? I tried to access directory name (d_name) but it didn't work out (or perhaps I made a mistake). Could someone share ideas about this?
Thank's in advance. (3 Replies)
Hello,
Recently I need to create a filesystem related code.
I noticed lot of inconsistent documentation regarding
struct dirent:
1. 'd_namlen' field
info libc in chapter ''File System Interface"
specifies 'd_namlen' field as length of 'd_name' string.
When compiling under Linux (and GNU... (3 Replies)
hi all,
im using dirent.h headers readdir() function to traverse down a directory ( after openning it with opendir() ), and im printing the dir->d_name in a program.
while(( dir = readdir( d ) ) != NULL ){
if (stat(, &info) != 0){
fprintf(stderr, "stat() error on %s: %s\n",... (2 Replies)
I'm trying to figure out how to support Unicode or atleast an unsigned char in the d_name of struct dirent
The problem i'm facing is that I'm checking file names for special characters and obviously the "char d_name" doesn't like it. I'm looping through the directory and getting the file... (3 Replies)