[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
FILETIME
. Summary
filetime(str <filespec>);
. Description
The filetime function returns the date/time of the specified file.
<filespec> is the name of the file and may include a drive and di-
rectory portion, as well as the DOS wildcard characters * and ?.
The values returned represents the file's modification date as the
number of seconds since Jan 1, 1970. A date/time in this form can be
used by the date, time, tyear, tmonth, tday, thour, tmin, tsec, and
other functions.
If <filespec> is blank (""), then the date/time of the last file
found with the filefind function is returned. Note that calling
filesize or fileattr in the meantime with a non-blank filename would
instead make this call return the time/date of files found with
those functions, as they use the same buffer.
. Return Value
An integer value representing the date/time of the indicated file is
returned, or a value of -1 is returned if the indicated file could
not be found.
. Example
int time;
str s[16];
time = filetime("TELIX.EXE");
if (time == -1)
prints("'TELIX.EXE" could not be found!");
else
{
printsc("TELIX.EXE was created at ");
time(time, s);
printsc(s);
printsc(" on ");
date(time, s);
printsc(s);
}
// this example assumes both files exist
if (filetime("FILE1") < filetime("FILE2"))
prints("FILE1 is older than FILE2");
else
prints("FILE1 is newer than FILE2");
See Also:
filefind
filesize
fileattr
tday
thour
tmin
tmonth
tsec
tyear
date
curtime
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson