Task

Get and set the modification time of a file.




iex(1)> info = File.stat!("input.txt")
%File.Stat{access: :read_write, atime: {{2015, 10, 29}, {20, 44, 28}},
 ctime: {{2015, 9, 20}, {9, 5, 58}}, gid: 0, inode: 0, links: 1,
 major_device: 3, minor_device: 0, mode: 33206,
 mtime: {{2015, 10, 29}, {20, 44, 28}}, size: 45, type: :regular, uid: 0}
iex(2)> info.mtime
{{2015, 10, 29}, {20, 44, 28}}
iex(3)> File.touch!("input.txt")
:ok
iex(4)> File.stat!("input.txt")
%File.Stat{access: :read_write, atime: {{2016, 3, 7}, {23, 12, 35}},
 ctime: {{2016, 3, 7}, {23, 12, 35}}, gid: 0, inode: 0, links: 1,
 major_device: 3, minor_device: 0, mode: 33206,
 mtime: {{2016, 3, 7}, {23, 12, 35}}, size: 45, type: :regular, uid: 0}
