SYS_DirExists Function

Action

Checks whether the specified directory exists.

Syntax

bExists = SYS_DirExists (sDir)
Variable Description
bExists Whether the directory exists. TRUE if it does exist and FALSE if it does not. BOOLEAN.
sDir The directory to check for. STRING.

Notes

SYS_DirExists works only on names of true directories, not on names of shared directories. If your script includes a call to SYS_DirExists for a shared directory, SYS_DirExists returns FALSE, not because the directory does not exist but because the directory is shared.

Windows Platforms

SYS_DirExists is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sTempDir
BOOLEAN bExists

sTempDir = SYS_GetDir () + "\tempdir"
bExists = SYS_DirExists (sTempDir)
Print (bExists) // prints: FALSE

SYS_MakeDir (sTempDir) // make subdirectory
bExists = SYS_DirExists (sTempDir)
Print (bExists) // prints: TRUE