Task

Get and set the modification time of a file.




var file = File.new(__FILE__);
say file.stat.mtime;            # seconds since the epoch
 
# keep atime unchanged
# set mtime to current time
file.utime(file.stat.atime, Time.now);