home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / nfsrc21.zip / EXIST.PRG < prev    next >
Text File  |  1992-09-28  |  2KB  |  75 lines

  1. /*
  2.  * File......: EXIST.PRG
  3.  * Author....: Steve Kolterman
  4.  * CIS ID....: 76320,37
  5.  * Date......: $Date:   28 Sep 1992 01:09:44  $
  6.  * Revision..: $Revision:   1.3  $
  7.  * Log file..: $Logfile:   C:/nanfor/src/exist.prv  $
  8.  * 
  9.  * This is an original work by Steve Kolterman and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log:   C:/nanfor/src/exist.prv  $
  16.  * 
  17.  *    Rev 1.3   28 Sep 1992 01:09:44   GLENN
  18.  * Steve Kolterman clarified documentation on ft_exist()'s utility on 
  19.  * networks.
  20.  * 
  21.  *    Rev 1.2   15 Aug 1991 23:03:34   GLENN
  22.  * Forest Belt proofread/edited/cleaned up doc
  23.  * 
  24.  *    Rev 1.1   14 Jun 1991 19:51:48   GLENN
  25.  * Minor edit to file header
  26.  * 
  27.  *    Rev 1.0   01 Apr 1991 01:01:20   GLENN
  28.  * Nanforum Toolkit
  29.  *
  30.  */
  31.  
  32. /*  $DOC$
  33.  *  $FUNCNAME$
  34.  *     FT_EXIST()
  35.  *  $CATEGORY$
  36.  *     Environment
  37.  *  $ONELINER$
  38.  *     Test for drive and/or subdir on SINGLE-USER systems only.
  39.  *  $SYNTAX$
  40.  *     FT_EXIST( <cDriveDir> ) -> lResult
  41.  *  $ARGUMENTS$
  42.  *     <cDriveDir> is a character string containing drive spec (with colon)
  43.  *     or drive spec and path to and including subdirectory being tested
  44.  *     for.  Do not include backslash after subdirectory.  If drive spec
  45.  *     is not part of string, the current drive is tested.
  46.  *  $RETURNS$
  47.  *     <lResult>  as logical -
  48.  *     .T. if drive exists, or subdirectory exists on specified drive
  49.  *     .F. if drive or subdirectory does not exist
  50.  *  $DESCRIPTION$
  51.  *     FT_Exist() tests for the existence of a drive and/or subdirectory...
  52.  *     on single-user systems ONLY.  You may get correct results on some
  53.  *     networks under certain conditions, but this function is not capable
  54.  *     of working reliably on networks.
  55.  *  $EXAMPLES$
  56.  *    IF FT_EXIST( "D:" )
  57.  *       Qout("OK To Perform Operation On Drive D:") 
  58.  *    ENDIF
  59.  *  $END$
  60.  */
  61.  
  62.  
  63. /*   Pre-processor option:
  64.  *
  65.  *    #translate FT_EXIST(<drv>) => ;
  66.  *         FILE((<drv>+IF(SUBS(<drv>,-1,1)=="\","","\")+"NUL"))
  67.  *
  68.  */
  69.  
  70.  
  71. FUNCTION FT_EXIST( cDrvDir )
  72.   // check for "\" passed; add if necessary
  73. RETURN FILE(( cDrvDir + IF(SUBS( cDrvDir, -1, 1) == "\", "", "\" ) + "NUL" ) )
  74.  
  75.