diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2014-02-02 16:18:20 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2014-02-02 16:18:20 -0800 |
commit | 7b3f95d8103738c16cbc2442a8eff68d343f5e7e (patch) | |
tree | c06ad5116fef5d63cb4631c53358e67734189aea | |
parent | e75814da6776ccc9ec0637ec3fe8b1047ec422d0 (diff) | |
parent | 52d4e07146f29f9a0af29e99a94ef4f5a1fd1cbf (diff) | |
download | Nim-7b3f95d8103738c16cbc2442a8eff68d343f5e7e.tar.gz |
Merge pull request #864 from gradha/pr_adds_posix_utimes
Adds utimes() importc to posix module.
-rw-r--r-- | lib/posix/posix.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index c3d5b5939..41260b36f 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -2566,3 +2566,15 @@ proc poll*(a1: ptr TPollfd, a2: Tnfds, a3: int): cint {. proc realpath*(name, resolved: cstring): cstring {. importc: "realpath", header: "<stdlib.h>".} + +proc utimes*(path: cstring, times: ptr array [2, Ttimeval]): int {. + importc: "utimes", header: "<sys/time.h>".} + ## Sets file access and modification times. + ## + ## Pass the filename and an array of times to set the access and modification + ## times respectively. If you pass nil as the array both attributes will be + ## set to the current time. + ## + ## Returns zero on success. + ## + ## For more information read http://www.unix.com/man-page/posix/3/utimes/. |