File modification time: Difference between revisions
Content added Content deleted
(Omit Axe) |
(Initial implementation) |
||
Line 24: | Line 24: | ||
Put_Line (Image (Modification_Time ("file_time_test.adb"))); |
Put_Line (Image (Modification_Time ("file_time_test.adb"))); |
||
end File_Time_Test;</lang> |
end File_Time_Test;</lang> |
||
=={{header|ALGOL 68}}== |
|||
Definition of the PROC is lifted from the Algol68 Genie documentation. |
|||
<lang algol68>PROC get output = (STRING cmd) VOID: |
|||
IF STRING sh cmd = " " + cmd + " ; 2>&1"; |
|||
STRING output; |
|||
execve output ("/bin/sh", ("sh", "-c", sh cmd), "", output) >= 0 |
|||
THEN print (output) FI; |
|||
get output ("rm -rf foo"); CO Ensure file doesn't exist CO |
|||
get output ("touch foo"); CO Create file CO |
|||
get output ("ls -l --time-style=full-iso foo"); CO Display its last modified time CO |
|||
get output ("touch -t 200109111246 foo"); CO Change its last modified time CO |
|||
get output ("ls -l --time-style=full-iso foo") CO Verify it changed CO |
|||
</lang> |
|||
{{Out}} |
|||
<pre>-rw-r--r-- 1 pcl pcl 0 2015-08-10 17:48:39.712975830 +0100 foo |
|||
-rw-r--r-- 1 pcl pcl 0 2001-09-11 12:46:00.000000000 +0100 foo</pre> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |