home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / dirs.swg / 0022_Check for Directory.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-09-26  |  731 b   |  23 lines

  1.  
  2. {*****************************************************************************
  3.  * Function ...... IsDir()
  4.  * Purpose ....... To check for the existance of a directory
  5.  * Parameters .... Dir        Dir to check for
  6.  * Returns ....... TRUE if Dir exists
  7.  * Notes ......... None
  8.  * Author ........ Martin Richardson
  9.  * Date .......... May 13, 1992
  10.  *****************************************************************************}
  11. FUNCTION IsDir( Dir: STRING ) : BOOLEAN;
  12. VAR
  13.    fHandle: FILE;
  14.    wAttr: WORD;
  15. BEGIN
  16.      WHILE Dir[LENGTH(Dir)] = '\' DO DEC( Dir[0] );
  17.      Dir := Dir + '\.';
  18.      ASSIGN( fHandle, Dir );
  19.      GETFATTR( fHandle, wAttr );
  20.      IsDir := ( (wAttr AND DIRECTORY) = DIRECTORY );
  21. END;
  22.  
  23.