From 52d4e07146f29f9a0af29e99a94ef4f5a1fd1cbf Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 2 Feb 2014 23:28:17 +0100 Subject: [PATCH] Adds utimes() importc to posix module. --- lib/posix/posix.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index c3d5b5939e..41260b36fc 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: "".} + +proc utimes*(path: cstring, times: ptr array [2, Ttimeval]): int {. + importc: "utimes", header: "".} + ## 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/.