mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
Fix posix.nim dirent structure to be more compatible with OSes. (#5623)
This commit is contained in:
committed by
Andreas Rumpf
parent
3fc75b2ca4
commit
977758fe06
@@ -109,12 +109,17 @@ type
|
||||
Dirent* {.importc: "struct dirent",
|
||||
header: "<dirent.h>", final, pure.} = object ## dirent_t struct
|
||||
d_ino*: Ino ## File serial number.
|
||||
when defined(linux) or defined(macosx) or defined(bsd):
|
||||
when defined(dragonfly):
|
||||
# DragonflyBSD doesn't have `d_reclen` field.
|
||||
d_type*: uint8
|
||||
elif defined(linux) or defined(macosx) or defined(freebsd) or
|
||||
defined(netbsd) or defined(openbsd):
|
||||
d_reclen*: cshort ## Length of this record. (not POSIX)
|
||||
d_type*: int8 ## Type of file; not supported by all filesystem types.
|
||||
## (not POSIX)
|
||||
when defined(linux) or defined(bsd):
|
||||
when defined(linux) or defined(openbsd):
|
||||
d_off*: Off ## Not an offset. Value that ``telldir()`` would return.
|
||||
|
||||
d_name*: array[0..255, char] ## Name of entry.
|
||||
|
||||
Tflock* {.importc: "struct flock", final, pure,
|
||||
|
||||
Reference in New Issue
Block a user