Jump to content

File modification time: Difference between revisions

Updated D entry
m (→‎{{header|Go}}: library change)
(Updated D entry)
Line 332:
 
=={{header|D}}==
<lang d>import std.stdio;
{{works with|D|2}}
<lang d>import std.file: getTimes, setTimes, d_timeSysTime;
 
void main() {
auto fname = "unixdict.txt";
d_time creation_time, access_time, modified_time;
SysTime fileAccessTime, fileModificationTime;
getTimes("data.txt", creation_time, access_time, modified_time);
getTimes(fname, fileAccessTime, fileModificationTime);
setTimes("data.txt", access_time, modified_time);
writeln(fileAccessTime, "\n", fileModificationTime);
setTimes(fname, fileAccessTime, fileModificationTime);
}</lang>
For Windows systems there is also getTimesWin(), that gives the file creation time too.
 
=={{header|Delphi}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.