mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
26 lines
499 B
Nim
26 lines
499 B
Nim
discard """
|
|
outputsub: "is newer than"
|
|
"""
|
|
# test the new LastModificationTime() proc
|
|
|
|
let
|
|
file1 = "tests/testdata/data.csv"
|
|
file2 = "tests/testdata/doc1.xml"
|
|
|
|
import
|
|
os, times, strutils
|
|
|
|
proc main() =
|
|
var
|
|
a, b: Time
|
|
a = getLastModificationTime(file1)
|
|
b = getLastModificationTime(file2)
|
|
writeLine(stdout, $a)
|
|
writeLine(stdout, $b)
|
|
if a < b:
|
|
write(stdout, "$2 is newer than $1\n" % [file1, file2])
|
|
else:
|
|
write(stdout, "$1 is newer than $2\n" % [file1, file2])
|
|
|
|
main()
|