Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> filesize() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    FILESIZE()

Purpose:     Retrieve the size of a file from DOS directory information.

Syntax:      FILESIZE( filename )

Arguments:   filename    - Character string or variable indicating the
                           name of the file for which to extract the size.
                           This filename (filespec) must and may adhere to
                           any fully qualified filename as required by
                           ADIR().

Returns:     Numeric size in bytes of <filename> from the DOS directory
             entry.

Description: This function extracts the size from the given file directory
             entry information.  It is useful for comparing the sizes of
             two files, or for using the file size for a variety of
             purposes.

Notes:       If an invalid filename is given, or if the file does not
             exist, FILESIZE() will return zero.  Beware that if the file
             being checked is currently open, the size from the directory
             entry may not reflect updates until the file is closed.

             Since FILESIZE() uses ADIR() (and presumably DOS directory's
             function calls) the file does not have to be opened with
             FOPEN() to get the size.  This can be useful if file handles
             are in short supply.

Example:     *-- verify enough disk space for a faster sort operation
             IF DISKSPACE(0) > FILESIZE("myfile.dbf")
                USE myfile INDEX myfile
                COPY TO myfile.sor
                USE
                ERASE myfile.dbf
                RENAME myfile.sor TO myfile.dbf
             ELSE
                BUZZ()
                SAYINBOX( "R/W", "Insufficient disk space!", 30 )
             ENDIF

Source:      RL_FSIZE.PRG

See also:    FILEDATE(), FILETIME()

See Also: FILEDATE() FILETIME()

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