dirent(5) File Formats Manual dirent(5)NAME
dirent.h - format of directory streams and directory entries
SYNOPSIS DESCRIPTION
This header file defines data types used by the directory stream routines described in directory(3C).
The following data types are defined:
A structure containing information about an open directory stream.
A structure defining the format of entries returned
by the function (see directory(3C)).
The structure includes the following members:
char d_name[MAXNAMLEN+1]; /* name of directory entry */
ino_t d_ino; /* file serial number */
short d_namlen; /* length of string in d_name */
short d_reclen; /* length of this record */
The constant is defined in
Note that the entry is used internally to represent the offset from the current entry to the next valid entry. Therefore, is not the
length of the current entry, but the length of the current record where a record is an entry plus any currently unused space between the
current entry and the next valid entry. The unused space between valid entries results from changes in a directory's contents, such as the
deletion of files and other directories.
This file also contains external declarations for the functions that perform directory operations (see directory(3C)).
WARNINGS
For 32-bit applications, the d_ino field may overflow for filesystems that use 64-bit values. In this case, the most-significant bytes
will be truncated without error, and the value may not be unique.
AUTHOR
was developed by AT&T and HP.
SEE ALSO directory(3C).
STANDARDS CONFORMANCE dirent(5)
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.11 10 Sep 2004 dirent.h(3HEAD)
Hi all,
I tried to write a shell to read huge file and eliminate max length record which is wrong generated record. But I get an error
remove_sp.sh: line 27: syntax error near unexpected token `else'
remove_sp.sh: line 27: ` else $LINE >> REJFILE'
My shell is here:
#!/bin/sh... (5 Replies)
I'm not sure where to post this but I'm having some trouble with the directories in CP/M... I'm sorry about the length but I'm totally confused... I've seen that the directory entry in CP/M contains the following:
1 byte User Code
8 bytes Filename
3 bytes File extension
1 byte Extension
2... (3 Replies)
Hi,
I would really appreciate if you could help me with this. I have a directory structure like this :-
/data
Under data i have directories /data1 , /input_files , /output_files etc . Under these directories I have other subdirectories.
What i am looking for is to find out the size of all... (5 Replies)
Hi there, using the command below
> cat file1 | tr "\001" " " > tmp2
how can I alter the record length of tmp2 to fix length of 350 bytes ?
Thanks a lot! (7 Replies)
Hello,
Is there anyway of getting the index of the last entry in a directory? I'm using a C program to read the entries, but I want to go to the last entry because the directory is very big and I don't want to read all. I was using the size of the directory file descriptor but when I remove... (4 Replies)
Hi,
I have a huge directory structure with multiple directories and subdirectories in each of the directory.
i am trying to find the various file extensions in the directory structure and put them into a file.
is there any way through which i can accomplish this (4 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)
Hey everyone
I am just trying print a directory structure but I am not getting the desired output.
I am using AIX.
Script :
input file contains : TNP\\ECOM\\test\\1
input_file=folders.txt
cat $input_file | while read line
do
echo $line
done (3 Replies)
I have two files which are pipe delimited "|". Also, each record in these files will end with a "|"
File 1
====
EMPID|NAME|DEPT
1|AAA|PPP
2|BBB|QQQ
3|CCC|RRR
4|DDD|SSS
5|EEE|TTT
File 2 (EMPID of those employees who have left the organisation)
====
EMPID|
2|
5|
I have to... (8 Replies)
Hello,
I have a directory structure of seismic files that are stored within about 1000 different directories. The directory structure is typically no more than two levels deep, and they are organized by station name and disc name. Each disc name folder contains a text file called 'vdaq.txt' that I... (4 Replies)
Hi,
In solaris I remember this direcotry structure
/proc/<pid>/fd
in this directory
ls -l | wc -l would give me the number of file descriptor for that process.
Where can I find the similar in HPUX (11 Replies)
Hi all,
I have one file with IDs
Q8NDM7
P0C1S8
Q8TF30
Q9BRP8
O00258
Q6AWC2
Q9ULE0
Q702N8
A4UGR9
Q13426
Q6P2D8
Q9ULM3
A8MXQ7
I want to compare ID file with another file which has complete information about these IDs and also about other IDs which are not in the above ID file. As... (10 Replies)
Hi All,
is there any work around to generate the file and directory structure like below at left side at Output? and exclude all file except .abc .txt
Current Directory structure
|-------------files
|---------------Share
|-----------------dir1
|-----------------dir2... (11 Replies)
I have two files. One file have length defined and other file have data.
I need to do some processing in data file only for the length mentioned in the length file.
my lenth file has one record with five bytes, need to store the last two bytes as length.
for example, if my file has a... (3 Replies)
I have a source file where a record starts with # entry-id: followed by a number.
i want to move the record in file 1 iff the second row is
"dn: uid=.*,ou=perm,dc=mssb,dc=com"
and the record to file 2 if contents of second row anything else
# entry-id: 1
dn:... (6 Replies)