File/Folder name to get times for.
Time the file/folder was last accessed.
Time the file/folder was last modified.
FileException on error.
import std.datetime : DateTime, hnsecs, SysTime; scope(exit) deleteme.remove; write(deleteme, "a"); SysTime accessTime = SysTime(DateTime(2010, 10, 4, 0, 0, 30)); SysTime modificationTime = SysTime(DateTime(2018, 10, 4, 0, 0, 30)); setTimes(deleteme, accessTime, modificationTime); SysTime accessTimeResolved, modificationTimeResolved; getTimes(deleteme, accessTimeResolved, modificationTimeResolved); assert(accessTime == accessTimeResolved); assert(modificationTime == modificationTimeResolved);
Set access/modified times of file or folder name.