Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>filesize()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FILESIZE()
 Determines the size of a file
------------------------------------------------------------------------------
 Syntax

     FILESIZE([<cFileMap>, [<FileAttr>]]) --> nFileSize

 Arguments

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

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

     ()  If the function is called without parameters, it returns the file
     size from the current FILESEEK() buffer.

 Returns

     FILESIZE() returns the designated file's size, the size from the
     FILESEEK() buffer (when called without a parameter), or -1.

 Description

     Implement FILESIZE() alone or in conjunction with FILESEEK().  If the
     function is called with the <cFileMap> parameter, it returns the size of
     the first entry found.  If no matching entry is available, then a value
     of -1  is returned

     When called without parameters, FILESIZE() returns the size of the most
     recent file found with FILESEEK().  Used in conjunction with FILESEEK(),
     you can also determine the size of file groups (wildcards).

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

     Table 7-16:  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)
     32      FA_ARCHIVE          ARCHIVE (Changes since last backup.)
     ------------------------------------------------------------------------

     Specify only the SYSTEM, HIDDEN, VOLUME, or DIR attributes for an entry
     to be found.  If multiple attributes are implemented simul-taneously,
     the table values are added accordingly.  Of course, not all combinations
     are useful.

 Examples

     .  Show the size of a particular file:

        ? FILESIZE("C:\TEXT\TEXT.TXT")      // File size or -1

     .  The size of an ARCHIVE/HIDDEN file:

        ? FILESIZE("C:\HIDE.TXT", 34")      // File size or -1

     .  Used in conjunction with FILESEEK():

        cFile  :=  FILESEEK(C:\TEXT.TXT")
        DO WHILE .NOT. EMPTY(cFile)
           ? cFile, FILESIZE()              // File name and size
           cFile  := FILESEEK()             // Search for next entry
        ENDDO


See Also: FILESEEK() FILEATTR() FILEDATE() FILETIME()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson