Debian Codegraph @

templates/man3/readdir.3.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:39+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "readdir"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid "readdir - read a directory"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "LIBRARY"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
61 #: opensuse-leap-16-1 opensuse-tumbleweed
62 msgid "Standard C library (I<libc>,\\ I<-lc>)"
63 msgstr ""
64
65 #. type: SH
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 #, no-wrap
69 msgid "SYNOPSIS"
70 msgstr ""
71
72 #. type: Plain text
73 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
74 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
75 #, no-wrap
76 msgid "B<#include E<lt>dirent.hE<gt>>\n"
77 msgstr ""
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "B<struct dirent *readdir(DIR *>I<dirp>B<);>\n"
84 msgstr ""
85
86 #. type: SH
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, no-wrap
90 msgid "DESCRIPTION"
91 msgstr ""
92
93 #. type: Plain text
94 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
95 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
96 msgid ""
97 "The B<readdir>() function returns a pointer to a I<dirent> structure "
98 "representing the next directory entry in the directory stream pointed to by "
99 "I<dirp>. It returns NULL on reaching the end of the directory stream or if "
100 "an error occurred."
101 msgstr ""
102
103 #. type: Plain text
104 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
105 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
106 msgid ""
107 "In the glibc implementation, the I<dirent> structure is defined as follows:"
108 msgstr ""
109
110 #. type: Plain text
111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
113 #, no-wrap
114 msgid ""
115 "struct dirent {\n"
116 " ino_t d_ino; /* Inode number */\n"
117 " off_t d_off; /* Not an offset; see below */\n"
118 " unsigned short d_reclen; /* Length of this record */\n"
119 " unsigned char d_type; /* Type of file; not supported\n"
120 " by all filesystem types */\n"
121 " char d_name[256]; /* Null-terminated filename */\n"
122 "};\n"
123 msgstr ""
124
125 #. type: Plain text
126 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
127 #: opensuse-tumbleweed
128 msgid ""
129 "The only fields in the I<dirent> structure that are mandated by POSIX.1 are "
130 "I<.d_name> and I<.d_ino>. The other fields are unstandardized, and not "
131 "present on all systems; see VERSIONS."
132 msgstr ""
133
134 #. type: Plain text
135 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
136 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
137 msgid "The fields of the I<dirent> structure are as follows:"
138 msgstr ""
139
140 #. type: TP
141 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
142 #: opensuse-tumbleweed
143 #, no-wrap
144 msgid "I<.d_ino>"
145 msgstr ""
146
147 #. type: Plain text
148 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
149 #: opensuse-tumbleweed
150 msgid ""
151 "This is the inode number of the file in the filesystem containing the "
152 "directory on which B<readdir>() was called. If the directory entry is a "
153 "mount point, then I<.d_ino> differs from I<.st_ino> returned by B<stat>(2) "
154 "on this file: I<.d_ino> is the inode number of the mount point, while "
155 "I<.st_ino> is the inode number of the root directory of the mounted "
156 "filesystem."
157 msgstr ""
158
159 #. type: TP
160 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
161 #: opensuse-tumbleweed
162 #, no-wrap
163 msgid "I<.d_off>"
164 msgstr ""
165
166 #. https://lwn.net/Articles/544298/
167 #. type: Plain text
168 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
169 #: opensuse-tumbleweed
170 msgid ""
171 "The value returned in I<.d_off> is the same as would be returned by calling "
172 "B<telldir>(3) at the current position in the directory stream. Be aware "
173 "that despite its type and name, the I<.d_off> field is seldom any kind of "
174 "directory offset on modern filesystems. Applications should treat this "
175 "field as an opaque value, making no assumptions about its contents; see also "
176 "B<telldir>(3)."
177 msgstr ""
178
179 #. type: TP
180 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
181 #: opensuse-tumbleweed
182 #, no-wrap
183 msgid "I<.d_reclen>"
184 msgstr ""
185
186 #. type: Plain text
187 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
188 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
189 msgid ""
190 "This is the size (in bytes) of the returned record. This may not match the "
191 "size of the structure definition shown above; see VERSIONS."
192 msgstr ""
193
194 #. type: TP
195 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
196 #: opensuse-tumbleweed
197 #, no-wrap
198 msgid "I<.d_type>"
199 msgstr ""
200
201 #. type: Plain text
202 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
203 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
204 msgid ""
205 "This field contains a value indicating the file type, making it possible to "
206 "avoid the expense of calling B<lstat>(2) if further actions depend on the "
207 "type of the file."
208 msgstr ""
209
210 #. type: Plain text
211 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
212 #: opensuse-tumbleweed
213 msgid ""
214 "When a suitable feature test macro is defined (B<_DEFAULT_SOURCE> since "
215 "glibc 2.19, or B<_BSD_SOURCE> on glibc 2.19 and earlier), glibc defines the "
216 "following macro constants for the value returned in I<.d_type>:"
217 msgstr ""
218
219 #. type: TP
220 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
221 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
222 #, no-wrap
223 msgid "B<DT_BLK>"
224 msgstr ""
225
226 #. type: Plain text
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 msgid "This is a block device."
230 msgstr ""
231
232 #. type: TP
233 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
234 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
235 #, no-wrap
236 msgid "B<DT_CHR>"
237 msgstr ""
238
239 #. type: Plain text
240 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
241 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
242 msgid "This is a character device."
243 msgstr ""
244
245 #. type: TP
246 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
247 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
248 #, no-wrap
249 msgid "B<DT_DIR>"
250 msgstr ""
251
252 #. type: Plain text
253 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
254 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
255 msgid "This is a directory."
256 msgstr ""
257
258 #. type: TP
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 #, no-wrap
262 msgid "B<DT_FIFO>"
263 msgstr ""
264
265 #. type: Plain text
266 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
267 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
268 msgid "This is a named pipe (FIFO)."
269 msgstr ""
270
271 #. type: TP
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 #, no-wrap
275 msgid "B<DT_LNK>"
276 msgstr ""
277
278 #. type: Plain text
279 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
280 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
281 msgid "This is a symbolic link."
282 msgstr ""
283
284 #. type: TP
285 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
286 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
287 #, no-wrap
288 msgid "B<DT_REG>"
289 msgstr ""
290
291 #. type: Plain text
292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
294 msgid "This is a regular file."
295 msgstr ""
296
297 #. type: TP
298 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
299 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
300 #, no-wrap
301 msgid "B<DT_SOCK>"
302 msgstr ""
303
304 #. type: Plain text
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 msgid "This is a UNIX domain socket."
308 msgstr ""
309
310 #. type: TP
311 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
312 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
313 #, no-wrap
314 msgid "B<DT_UNKNOWN>"
315 msgstr ""
316
317 #. type: Plain text
318 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
319 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
320 msgid "The file type could not be determined."
321 msgstr ""
322
323 #. kernel 2.6.27
324 #. The same sentence is in getdents.2
325 #. type: Plain text
326 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
327 #: opensuse-tumbleweed
328 msgid ""
329 "Currently, only some filesystems (among them: Btrfs, ext2, ext3, and ext4) "
330 "have full support for returning the file type in I<.d_type>. All "
331 "applications must properly handle a return of B<DT_UNKNOWN>."
332 msgstr ""
333
334 #. type: TP
335 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
336 #: opensuse-tumbleweed
337 #, no-wrap
338 msgid "I<.d_name>"
339 msgstr ""
340
341 #. type: Plain text
342 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
343 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
344 msgid "This field contains the null terminated filename; see VERSIONS."
345 msgstr ""
346
347 #. type: Plain text
348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
350 msgid ""
351 "The data returned by B<readdir>() may be overwritten by subsequent calls to "
352 "B<readdir>() for the same directory stream."
353 msgstr ""
354
355 #. type: SH
356 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
357 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
358 #, no-wrap
359 msgid "RETURN VALUE"
360 msgstr ""
361
362 #. type: Plain text
363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
365 msgid ""
366 "On success, B<readdir>() returns a pointer to a I<dirent> structure. (This "
367 "structure may be statically allocated; do not attempt to B<free>(3) it.)"
368 msgstr ""
369
370 #. type: Plain text
371 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
372 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
373 msgid ""
374 "If the end of the directory stream is reached, NULL is returned and I<errno> "
375 "is not changed. If an error occurs, NULL is returned and I<errno> is set to "
376 "indicate the error. To distinguish end of stream from an error, set "
377 "I<errno> to zero before calling B<readdir>() and then check the value of "
378 "I<errno> if NULL is returned."
379 msgstr ""
380
381 #. type: SH
382 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
383 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
384 #, no-wrap
385 msgid "ERRORS"
386 msgstr ""
387
388 #. type: TP
389 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
390 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
391 #, no-wrap
392 msgid "B<EBADF>"
393 msgstr ""
394
395 #. type: Plain text
396 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
397 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
398 msgid "Invalid directory stream descriptor I<dirp>."
399 msgstr ""
400
401 #. type: SH
402 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
403 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
404 #, no-wrap
405 msgid "ATTRIBUTES"
406 msgstr ""
407
408 #. type: Plain text
409 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
410 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
411 msgid ""
412 "For an explanation of the terms used in this section, see B<attributes>(7)."
413 msgstr ""
414
415 #. type: tbl table
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 #, no-wrap
419 msgid "Interface"
420 msgstr ""
421
422 #. type: tbl table
423 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
424 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
425 #, no-wrap
426 msgid "Attribute"
427 msgstr ""
428
429 #. type: tbl table
430 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
431 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
432 #, no-wrap
433 msgid "Value"
434 msgstr ""
435
436 #. type: tbl table
437 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
438 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
439 #, no-wrap
440 msgid ".na\n"
441 msgstr ""
442
443 #. type: tbl table
444 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
445 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
446 #, no-wrap
447 msgid ".nh\n"
448 msgstr ""
449
450 #. type: tbl table
451 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
452 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
453 #, no-wrap
454 msgid "B<readdir>()"
455 msgstr ""
456
457 #. type: tbl table
458 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
459 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
460 #, no-wrap
461 msgid "Thread safety"
462 msgstr ""
463
464 #. type: tbl table
465 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
466 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
467 #, no-wrap
468 msgid "MT-Unsafe race:dirstream"
469 msgstr ""
470
471 #. FIXME .
472 #. http://www.austingroupbugs.net/view.php?id=696
473 #. type: Plain text
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 msgid ""
477 "In the current POSIX.1 specification (POSIX.1-2008), B<readdir>() is not "
478 "required to be thread-safe. However, in modern implementations (including "
479 "the glibc implementation), concurrent calls to B<readdir>() that specify "
480 "different directory streams are thread-safe. In cases where multiple "
481 "threads must read from the same directory stream, using B<readdir>() with "
482 "external synchronization is still preferable to the use of the deprecated "
483 "B<readdir_r>(3) function. It is expected that a future version of POSIX.1 "
484 "will require that B<readdir>() be thread-safe when concurrently employed on "
485 "different directory streams."
486 msgstr ""
487
488 #. type: SH
489 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
490 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
491 #, no-wrap
492 msgid "VERSIONS"
493 msgstr ""
494
495 #. POSIX.1-2001, POSIX.1-2008
496 #. type: Plain text
497 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
498 #: opensuse-tumbleweed
499 msgid ""
500 "Only the fields I<.d_name> and (as an XSI extension) I<.d_ino> are "
501 "specified in POSIX.1. Other than Linux, the I<.d_type> field is available "
502 "mainly only on BSD systems. The remaining fields are available on many, but "
503 "not all systems. Under glibc, programs can check for the availability of "
504 "the fields not defined in POSIX.1 by testing whether the macros "
505 "B<_DIRENT_HAVE_D_NAMLEN>, B<_DIRENT_HAVE_D_RECLEN>, B<_DIRENT_HAVE_D_OFF>, "
506 "or B<_DIRENT_HAVE_D_TYPE> are defined."
507 msgstr ""
508
509 #. type: SS
510 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
511 #: opensuse-tumbleweed
512 #, no-wrap
513 msgid "The \\f[I].d_name\\fB field"
514 msgstr ""
515
516 #. type: Plain text
517 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
518 #: opensuse-tumbleweed
519 msgid ""
520 "The I<dirent> structure definition shown above is taken from the glibc "
521 "headers, and shows the I<.d_name> field with a fixed size."
522 msgstr ""
523
524 #. type: Plain text
525 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
526 #: opensuse-tumbleweed
527 msgid ""
528 "I<Warning>: applications should avoid any dependence on the size of the "
529 "I<.d_name> field. POSIX defines it as I<char\\ d_name[]>, a character array "
530 "of unspecified size, with at most B<NAME_MAX> characters preceding the "
531 "terminating null byte (\\[aq]\\[rs]0\\[aq])."
532 msgstr ""
533
534 #. type: Plain text
535 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
536 #: opensuse-tumbleweed
537 msgid ""
538 "POSIX.1 explicitly notes that this field should not be used as an lvalue. "
539 "The standard also notes that the use of I<sizeof(.d_name)> is incorrect; use "
540 "I<strlen(.d_name)> instead. (On some systems, this field is defined as "
541 "I<char\\ d_name[1]>!) By implication, the use I<sizeof(struct dirent)> to "
542 "capture the size of the record including the size of I<.d_name> is also "
543 "incorrect."
544 msgstr ""
545
546 #. type: Plain text
547 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
548 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
549 msgid "Note that while the call"
550 msgstr ""
551
552 #. type: Plain text
553 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
554 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
555 #, no-wrap
556 msgid "fpathconf(fd, _PC_NAME_MAX)\n"
557 msgstr ""
558
559 #. type: Plain text
560 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
561 #: opensuse-tumbleweed
562 msgid ""
563 "returns the value 255 for most filesystems, on some filesystems (e.g., CIFS, "
564 "Windows SMB servers), the null-terminated filename that is (correctly) "
565 "returned in I<.d_name> can actually exceed this size. In such cases, the "
566 "I<.d_reclen> field will contain a value that exceeds the size of the glibc "
567 "I<dirent> structure shown above."
568 msgstr ""
569
570 #. type: SH
571 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
572 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
573 #, no-wrap
574 msgid "STANDARDS"
575 msgstr ""
576
577 #. type: Plain text
578 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
579 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
580 msgid "POSIX.1-2008."
581 msgstr ""
582
583 #. type: SH
584 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
585 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
586 #, no-wrap
587 msgid "HISTORY"
588 msgstr ""
589
590 #. type: Plain text
591 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
592 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
593 msgid "POSIX.1-2001, SVr4, 4.3BSD."
594 msgstr ""
595
596 #. type: SH
597 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
598 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
599 #, no-wrap
600 msgid "NOTES"
601 msgstr ""
602
603 #. type: Plain text
604 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
605 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
606 msgid "A directory stream is opened using B<opendir>(3)."
607 msgstr ""
608
609 #. type: Plain text
610 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
611 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
612 msgid ""
613 "The order in which filenames are read by successive calls to B<readdir>() "
614 "depends on the filesystem implementation; it is unlikely that the names will "
615 "be sorted in any fashion."
616 msgstr ""
617
618 #. type: SH
619 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
620 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
621 #, no-wrap
622 msgid "SEE ALSO"
623 msgstr ""
624
625 #. type: Plain text
626 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
627 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
628 msgid ""
629 "B<getdents>(2), B<read>(2), B<closedir>(3), B<dirfd>(3), B<ftw>(3), "
630 "B<offsetof>(3), B<opendir>(3), B<readdir_r>(3), B<rewinddir>(3), "
631 "B<scandir>(3), B<seekdir>(3), B<telldir>(3)"
632 msgstr ""
633
634 #. type: TH
635 #: debian-trixie
636 #, no-wrap
637 msgid "2024-06-16"
638 msgstr ""
639
640 #. type: TH
641 #: debian-trixie
642 #, no-wrap
643 msgid "Linux man-pages 6.9.1"
644 msgstr ""
645
646 #. type: Plain text
647 #: debian-trixie
648 msgid "Standard C library (I<libc>, I<-lc>)"
649 msgstr ""
650
651 #. type: Plain text
652 #: debian-trixie fedora-44 fedora-rawhide
653 msgid ""
654 "The only fields in the I<dirent> structure that are mandated by POSIX.1 are "
655 "I<d_name> and I<d_ino>. The other fields are unstandardized, and not "
656 "present on all systems; see VERSIONS."
657 msgstr ""
658
659 #. type: TP
660 #: debian-trixie fedora-44 fedora-rawhide
661 #, no-wrap
662 msgid "I<d_ino>"
663 msgstr ""
664
665 #. type: Plain text
666 #: debian-trixie fedora-44 fedora-rawhide
667 msgid "This is the inode number of the file."
668 msgstr ""
669
670 #. type: TP
671 #: debian-trixie fedora-44 fedora-rawhide
672 #, no-wrap
673 msgid "I<d_off>"
674 msgstr ""
675
676 #. https://lwn.net/Articles/544298/
677 #. type: Plain text
678 #: debian-trixie fedora-44 fedora-rawhide
679 msgid ""
680 "The value returned in I<d_off> is the same as would be returned by calling "
681 "B<telldir>(3) at the current position in the directory stream. Be aware "
682 "that despite its type and name, the I<d_off> field is seldom any kind of "
683 "directory offset on modern filesystems. Applications should treat this "
684 "field as an opaque value, making no assumptions about its contents; see also "
685 "B<telldir>(3)."
686 msgstr ""
687
688 #. type: TP
689 #: debian-trixie fedora-44 fedora-rawhide
690 #, no-wrap
691 msgid "I<d_reclen>"
692 msgstr ""
693
694 #. type: TP
695 #: debian-trixie fedora-44 fedora-rawhide
696 #, no-wrap
697 msgid "I<d_type>"
698 msgstr ""
699
700 #. type: Plain text
701 #: debian-trixie fedora-44 fedora-rawhide
702 msgid ""
703 "When a suitable feature test macro is defined (B<_DEFAULT_SOURCE> since "
704 "glibc 2.19, or B<_BSD_SOURCE> on glibc 2.19 and earlier), glibc defines the "
705 "following macro constants for the value returned in I<d_type>:"
706 msgstr ""
707
708 #. kernel 2.6.27
709 #. The same sentence is in getdents.2
710 #. type: Plain text
711 #: debian-trixie fedora-44 fedora-rawhide
712 msgid ""
713 "Currently, only some filesystems (among them: Btrfs, ext2, ext3, and ext4) "
714 "have full support for returning the file type in I<d_type>. All "
715 "applications must properly handle a return of B<DT_UNKNOWN>."
716 msgstr ""
717
718 #. type: TP
719 #: debian-trixie fedora-44 fedora-rawhide
720 #, no-wrap
721 msgid "I<d_name>"
722 msgstr ""
723
724 #. POSIX.1-2001, POSIX.1-2008
725 #. type: Plain text
726 #: debian-trixie fedora-44 fedora-rawhide
727 msgid ""
728 "Only the fields I<d_name> and (as an XSI extension) I<d_ino> are specified "
729 "in POSIX.1. Other than Linux, the I<d_type> field is available mainly only "
730 "on BSD systems. The remaining fields are available on many, but not all "
731 "systems. Under glibc, programs can check for the availability of the fields "
732 "not defined in POSIX.1 by testing whether the macros "
733 "B<_DIRENT_HAVE_D_NAMLEN>, B<_DIRENT_HAVE_D_RECLEN>, B<_DIRENT_HAVE_D_OFF>, "
734 "or B<_DIRENT_HAVE_D_TYPE> are defined."
735 msgstr ""
736
737 #. type: SS
738 #: debian-trixie fedora-44 fedora-rawhide
739 #, no-wrap
740 msgid "The d_name field"
741 msgstr ""
742
743 #. type: Plain text
744 #: debian-trixie fedora-44 fedora-rawhide
745 msgid ""
746 "The I<dirent> structure definition shown above is taken from the glibc "
747 "headers, and shows the I<d_name> field with a fixed size."
748 msgstr ""
749
750 #. type: Plain text
751 #: debian-trixie fedora-44 fedora-rawhide
752 msgid ""
753 "I<Warning>: applications should avoid any dependence on the size of the "
754 "I<d_name> field. POSIX defines it as I<char\\ d_name[]>, a character array "
755 "of unspecified size, with at most B<NAME_MAX> characters preceding the "
756 "terminating null byte (\\[aq]\\[rs]0\\[aq])."
757 msgstr ""
758
759 #. type: Plain text
760 #: debian-trixie fedora-44 fedora-rawhide
761 msgid ""
762 "POSIX.1 explicitly notes that this field should not be used as an lvalue. "
763 "The standard also notes that the use of I<sizeof(d_name)> is incorrect; use "
764 "I<strlen(d_name)> instead. (On some systems, this field is defined as "
765 "I<char\\ d_name[1]>!) By implication, the use I<sizeof(struct dirent)> to "
766 "capture the size of the record including the size of I<d_name> is also "
767 "incorrect."
768 msgstr ""
769
770 #. type: Plain text
771 #: debian-trixie fedora-44 fedora-rawhide
772 msgid ""
773 "returns the value 255 for most filesystems, on some filesystems (e.g., CIFS, "
774 "Windows SMB servers), the null-terminated filename that is (correctly) "
775 "returned in I<d_name> can actually exceed this size. In such cases, the "
776 "I<d_reclen> field will contain a value that exceeds the size of the glibc "
777 "I<dirent> structure shown above."
778 msgstr ""
779
780 #. type: TH
781 #: fedora-44 fedora-rawhide
782 #, no-wrap
783 msgid "2024-07-23"
784 msgstr ""
785
786 #. type: TH
787 #: fedora-44 fedora-rawhide
788 #, no-wrap
789 msgid "Linux man-pages 6.13"
790 msgstr ""
791
792 #. type: TH
793 #: mageia-cauldron
794 #, no-wrap
795 msgid "Linux man-pages 6.17"
796 msgstr ""
797
798 #. type: TH
799 #: opensuse-leap-16-1 opensuse-tumbleweed
800 #, no-wrap
801 msgid "Linux man-pages (unreleased)"
802 msgstr ""