Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>diskspace()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DISKSPACE()


Syntax:     DISKSPACE([<expN>])

Purpose:    To determine the number of available bytes remaining on the
            specified disk drive.

Argument:   <expN> is the number of the drive to query where one is
            drive A, two is B, and three is C, etc.  The default is the
            current drive if <expN> is omitted or zero.

Returns:    An integer numeric value.

            DISKSPACE() returns the number of bytes of empty space on
            the specified disk drive.  If DISKSPACE() is specified
            without an argument, the return value reflects the amount of
            space available on the default drive.  It does not honor the
            DEFAULT drive.

Usage:      DISKSPACE() is useful when COPYing or SORTing to another
            drive and you want to determine if there is enough space
            available before initiating the operation. Another
            application is to use DISKSPACE() in combination with the
            RECSIZE() and RECCOUNT() functions to create a procedure to
            automatically backup database files.

Library:    EXTEND.LIB

Source:     EXAMPLEC.C


----------------------------------- Example --------------------------------

   This example is a user-defined function that demonstrates
   the use of DISKSPACE() to backup a database file to another drive.

   FUNCTION BackUp
   PARAMETERS outfile, drive
   *
   needed = INT((RECSIZE() * LASTREC()) +;
         HEADER() + 1)
   IF DISKSPACE() < needed
      RETURN .F.
   ENDIF
   COPY TO &drive.:&outfile.
   RETURN .T.


See Also: LASTREC() LUPDATE() RECSIZE()

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