$FUNCNAME$
  DISKSPACE()
$CATEGORY$
  DISKUTILS
$SUMMARY$
   Return the space available on a specified disk
$LANG_RU$
         .
$SYNTAX$
     DISKSPACE([<nDrive>]) --> nBytes
$LANG_RU$
     DISKSPACE([< >]) --> - 
$ARGUMENTS$
     <nDrive> is the number of the drive to query, where one is drive A,
     two is B, three is C, etc.  The default is the current DOS drive if
     <nDrive> is omitted or specified as zero.
$LANG_RU$
     < > -   ,  1 -   A, 2
     - B, 3 - C   .  < >     0,
        .
$RETURNS$
     DISKSPACE() returns the number of bytes of empty space on the specified
     disk drive as an integer numeric value.
$LANG_RU$
     DISKSPACE()       
         .
$DESCRIPTION$
     DISKSPACE() is an environment function that determines the number of
     available bytes remaining on the specified disk drive.  It is useful
     when COPYing or SORTing to another drive to determine if there is enough
     space available before initiating the operation.  You may also use
     DISKSPACE() with RECSIZE() and RECCOUNT() to create a procedure to back
     up database files.

     DISKSPACE() ignores the SET DEFAULT drive setting.
$LANG_RU$
     DISKSPACE() -   ,   
          .  , 
            
     ,        
       .   -  
      DISKSPACE()     RECSIZE()  RECCOUNT()
           .

      DISKSPACE()     ,
       SET DEFAULT.
$EXAMPLES$
       This example is a user-defined function that demonstrates the
	use of DISKSPACE() to back up a database file to another drive:

	FUNCTION BackUp( cTargetFile, cTargetDrive )
	   LOCAL nSpaceNeeded, nTargetDrive
	   //
	   nSpaceNeeded := INT((RECSIZE() * ;
	      LASTREC()) + HEADER() + 1)
	   nTargetDrive := ASC(UPPER(cTargetDrive)) - 64
	   //
	   IF DISKSPACE(nTargetDrive) < nSpaceNeeded
	      RETURN .F.
	   ENDIF
	   COPY TO (cTargetDrive + ":" + cTargetFile)
	   //
	   RETURN .T.
$LANG_RU$
           ,  
         DISKSPACE()     
         :

       FUNCTION BackUp( cTargetFile, cTargetDrive )
	  LOCAL nSpaceNeeded, nTargetDrive
	  //
	  nSpaceNeeded = INT( RECSIZE() * LASTREC()) + HEADER() + 1)
	  nTargetDrive := ASC( UPPER(cTargetDrive)) - 64
	  //
	  IF DISKSPACE(nTargetDrive) < nSpaceNeeded
	     RETURN .F.
	  ENDIF
	     COPY TO (cTargetDrive + ":" + cTargetFile)
	     //
	  RETURN .T.
$SEEALSO$
  LASTREC(),LUPDATE(),RECSIZE()
$END$
