FileDate

FileDate

Determines the file date

Syntax

      FileDate([<cFileMap>, [<nFileAttr>]]) --> <dFileDate>

Arguments

<cFileMap> : Designates a file name, including its path and drive designation. <nFileAttr> : Designates the file attribute explained in the table below. The default value is 0. () If you call this function without parameters, it returns the file date from the current FileSeek() buffer.

Returns

<dFileDate> : the date of the searched for entry, the date from the FileSeek() buffer (when called without parameters), or an empty date.

Description

You can implement FileDate() alone or in conjunction with FileSeek(). If you use the <cFileMap> parameter to call this function, it returns the date of the first entry found. If a suitable entry is not present, an empty date is returned.

When called without parameters, FileDate() returns the date of the last file it located with FileSeek(). You could also determine the dates for a file group (wildcards), when used it in conjunction with FileSeek().

The attribute for the desired file can be specified 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        DIR (Directory)
          32      FA_ARCHIVE          ARCHIVE (Changes since last backup)
          ---------------------------------------------------------------

To find a file, specify only the SYSTEM, HIDDEN, VOLUME, or DIR attributes. If multiple attributes are implemented simultaneously, the table values are added accordingly. Of course, not all combinations are useful.

Examples

      .  Show the date of a particular file:

         ? FileDate("C:\TEXT\TEXT.TXT")     // The date

      .  The date of an ARCHIVE/HIDDEN file:

         ? FileDate("C:\HIDE.TXT", 34)      // The date

      .  Used in conjunction with FileSeek():

         cFile  :=  FileSeek("C:\TEXT\*.TXT")
         DO WHILE .NOT. EMPTY(cFile)
            ? cFile, FileDate()             // Name & date of file
            cFile  :=  FileSeek()           // Search for next entry
         ENDDO

Seealso

FileSeek(), FileAttr(), FileSize(), FileTime()

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s