Change type of Timeval.tv_sec to posix.Time (#7646)
This commit is contained in:
parent
b9cafe5752
commit
fdf1d12380
9 changed files with 28 additions and 15 deletions
|
|
@ -1660,7 +1660,7 @@ proc setLastModificationTime*(file: string, t: times.Time) =
|
|||
## Sets the `file`'s last modification time. `OSError` is raised in case of
|
||||
## an error.
|
||||
when defined(posix):
|
||||
let unixt = t.toUnix.int
|
||||
let unixt = posix.Time(t.toUnix)
|
||||
var timevals = [Timeval(tv_sec: unixt), Timeval(tv_sec: unixt)] # [last access, last modification]
|
||||
if utimes(file, timevals.addr) != 0: raiseOSError(osLastError())
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue