RosettaCodeData/Task/File-modification-time/Lang/file-modification-time.lang

16 lines
457 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
# Load the IO module
# Replace "<pathToIO.lm>" with the location where the io.lm Lang module was installed to without "<" and ">"
ln.loadModule(<pathToIO.lm>)
$file = [[io]]::fp.openFile(input.txt)
$modTime = [[io]]::fp.getModificationDate($file)
fn.println(Mod Time: $modTime)
[[io]]::fp.setModificationDate($file, fn.currentTimeMillis())
$modTime = [[io]]::fp.getModificationDate($file)
fn.println(Mod Time now: $modTime)
[[io]]::fp.closeFile($file)