summary refs log tree commit diff stats
path: root/lib/posix
diff options
context:
space:
mode:
authordef <dennis@felsin9.de>2015-02-24 16:52:01 +0100
committerdef <dennis@felsin9.de>2015-02-24 16:52:01 +0100
commit18dd5e196508818f47fcf069479089ccb46f7eea (patch)
treeb1e0dbb8f8ac036acd24a6396b108cf9b32d9c36 /lib/posix
parent1adebdc7676e44c91daeee24745a63c2019e2ec3 (diff)
downloadNim-18dd5e196508818f47fcf069479089ccb46f7eea.tar.gz
Add some posix dirent documentation
Diffstat (limited to 'lib/posix')
-rw-r--r--lib/posix/posix.nim23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index 895e4b1d5..7d3e3ddba 100644
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -70,14 +70,14 @@ const
   STDIN_FILENO* = 0  ## File number of stdin;
   STDOUT_FILENO* = 1 ## File number of stdout;
 
-  DT_UNKNOWN* = 0
-  DT_FIFO* = 1
-  DT_CHR* = 2
-  DT_DIR* = 4
-  DT_BLK* = 6
-  DT_REG* = 8
-  DT_LNK* = 10
-  DT_SOCK* = 12
+  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
@@ -94,9 +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
-    d_reclen*: cshort
-    d_type*: int8
+    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,