FileTime

FileTime

Determines a file’s time

Syntax

      FileTime([<cFileMap>, [<nFileAttr>]]) --> <cFileClockTime>

Arguments

<cFileMap> : Designates the file name, including the path and drive designation.

<nFileAttr> : Designates the file attribute explained in the table below. The default value is 0.

() : If the function is called without parameters, it returns the file time from the current FileSeek() buffer.

Returns

<cFileClockTime> : the clock time for the <cFileMap>; the clock time from the FileSeek() buffer (when called without parameters), or a null string.

Description

Implement FileTime() alone or in conjunction with FileSeek(). If the function is called with the <cFileMap> parameter, it returns the time of the first entry found. If no matching entry is available, a null string is returned.

When called without parameters, FileTime() returns the clock time of the last file found with FileSeek(). You can also determine the clock time of file groups (wildcards) when the function is used in conjunction with FileSeek().

You can designate the attribute for the desired file in numeric form:

          Coding the File Attribute
          ---------------------------------------------------------------
          Value   Symb. constants     Assigned attribute
          ---------------------------------------------------------------
          0       FA_NORMAL
          1       FA_READONLY         READ ONLY (Read-only)
          2       FA_HIDDEN           HIDDEN (Hidden files)
          4       FA_SYSTEM           SYSTEM (System files)
          16      FA_DIRECTORY        (Subdirectory)
          32      FA_ARCHIVE          ARCHIVE (Changes since last backup)
          ---------------------------------------------------------------

Only the SYSTEM, HIDDEN, VOLUME, or DIR attributes must be specified for an entry to be found. If multiple attributes are implemented simultaneously, the table values are added accordingly. Of course, not all combinations are useful.

Examples

      .  The clock time of a particular file:

         ? FileTime("C:\TEXT\TEXT.TXT")      // File clock time or ""

      .  The clock time of an ARCHIVE/HIDDEN file:

         ? FileTime("C:\HIDE.TXT", 34")      // File clock time or ""

      .  Used in conjunction with FileSeek():

         cFile  :=  FileSeek(C:\TEXT.TXT")
         DO WHILE .NOT. EMPTY(cFile)
            ? cFile, FileTime()              // File name and clock time
            cFile  := FileSeek()             // Search for next entry
         ENDDO

Seealso

FileSeek(), FileAttr(), FileDate(), FileSize()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.