Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
16
Task/File-modification-time/Nim/file-modification-time.nim
Normal file
16
Task/File-modification-time/Nim/file-modification-time.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import os, times
|
||||
let accTime = getLastAccessTime("filename")
|
||||
let modTime = getLastModificationTime("filename")
|
||||
|
||||
import posix
|
||||
var unixAccTime = Timeval(tv_sec: int(accTime))
|
||||
var unixModTime = Timeval(tv_sec: int(modTime))
|
||||
|
||||
# Set the modification time
|
||||
unixModTime.tv_sec = 0
|
||||
|
||||
var times = [unixAccTime, unixModTime]
|
||||
discard utimes("filename", addr(times))
|
||||
|
||||
# Set the access and modification times to the current time
|
||||
discard utimes("filename", nil)
|
||||
Loading…
Add table
Add a link
Reference in a new issue