Description

Used to determine whether a specific directory exists within the operating system.

Syntax

retval = DirExists (path)

Parameters

The function has the following parameters:

ParameterDescription
pathThe full path of the directory being tested.

Returns

ValueMeaning
-1The path does not exist.
0The path is valid however it is not a directory.
1The path exists.

Example

* Determine if c:\temp exists
 
declare function DirExists
declare subroutine Msg
path = "C:\TEMP"
retval = DirExists(path)
 
begin case
   case retval = 0
     msg(@window,'The path ':path:' exists but is not a directory.')
   case retval = 1
     msg(@window,'The directory ':path:' does exist.')
   case retval = -1
     msg(@window,'The directory ':path:' does not exist.')
end case
  • No labels