diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-02-25 22:58:03 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-02-25 22:58:03 +0100 |
commit | 0ff4ed0ff30764dd4792396cd7a9eedfd8d0eee9 (patch) | |
tree | 075f6baa13e6250d21e164ba5d25c98740992cbb /lib/posix/posix.nim | |
parent | fce2ff161ea55bb73c076ab20d90730399a4059e (diff) | |
parent | 5e8eaa5f9755a6c8ed73ae0e49d399ac2dd3217c (diff) | |
download | Nim-0ff4ed0ff30764dd4792396cd7a9eedfd8d0eee9.tar.gz |
Merge pull request #2208 from def-/walkdir
Speed up walkDir significantly
Diffstat (limited to 'lib/posix/posix.nim')
-rw-r--r-- | lib/posix/posix.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index 845496756..7d3e3ddba 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -70,6 +70,16 @@ const STDIN_FILENO* = 0 ## File number of stdin; STDOUT_FILENO* = 1 ## File number of stdout; + DT_UNKNOWN* = 0 ## Unknown file type. + DT_FIFO* = 1 ## Named pipe, or FIFO. + DT_CHR* = 2 ## Character device. + DT_DIR* = 4 ## Directory. + DT_BLK* = 6 ## Block device. + DT_REG* = 8 ## Regular file. + DT_LNK* = 10 ## Symbolic link. + DT_SOCK* = 12 ## UNIX domain socket. + DT_WHT* = 14 + type TDIR* {.importc: "DIR", header: "<dirent.h>", incompleteStruct.} = object @@ -84,6 +94,10 @@ type Tdirent* {.importc: "struct dirent", header: "<dirent.h>", final, pure.} = object ## dirent_t struct d_ino*: Tino ## File serial number. + d_off*: TOff ## Not an offset. Value that ``telldir()`` would return. + d_reclen*: cshort ## Length of this record. (not POSIX) + d_type*: int8 ## Type of file; not supported by all filesystem types. + ## (not POSIX) d_name*: array [0..255, char] ## Name of entry. Tflock* {.importc: "struct flock", final, pure, |