Jump to content

File modification time: Difference between revisions

Added FreeBASIC
(Added FreeBASIC)
Line 569:
=={{header|Fortran}}==
No facility. The INQUIRE statement for files has no keywords to ascertain the disc file's creation time, last access time, last modification time, and much else also in a standardised way so there is no way to modify these items either. A particular installation may offer library routines (written in assembler perhaps), or a modified compiler with extra features, but in general, there is no facility - other than performing a file action at the desired time.
 
=={{header|FreeBASIC}}==
<lang freebasic>' FB 1.05.0 Win64
 
' This example is taken directly from the FB documentation (see [http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgFiledatetime])
 
#include "vbcompat.bi" '' to use Format function
 
Dim filename As String, d As Double
 
Print "Enter a filename: "
Line Input filename
 
If FileExists(filename) Then
Print "File last modified: ";
d = FileDateTime( filename )
Print Format( d, "yyyy-mm-dd hh:mm AM/PM" )
Else
Print "File not found"
End If
 
Sleep</lang>
 
Sample input/output:
 
{{out}}
<pre>
Enter a filename:
c:\windows\system32\kernel32.dll
File last modified: 2016-09-07 05:39 AM
</pre>
 
=={{header|Go}}==
9,488

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.