IsDir
Tests for the existence of directories
Syntax
IsDir( <cDirName> ) --> <lIsDirectory>
Arguments
<cDirName> : A character string holding the relative or absolute name of a directory.
Return
<lIsDirectory> : .T. (true) when the directory <cDirSpec> exists, otherwise .F. (false) is returned.
Description
The IsDir() function is used to check if a directory exists that matches the specification <cDirSpec>.
This is a character string containing the absolute or relative path of a directory.
Note
IsDir() is name abreviated version of IsDirectory()
Example
Assuming this directory tree and files exist : C:\ | temp D + ---- + Dir1 D | doc1.docx F | test1.bat F | test1.txt F + Dir2 D doc2.docx F test2.bat F test2.txt F ? IsDir( 'C:\' ) // .F. ? IsDir( 'C:\*.*' ) // .F. ? IsDir( 'C:\temp\*.*' ) // .T. ? IsDir( 'C:\temp\*.' ) // .T. ? IsDir( 'C:\temp\test*.*' ) // .F. ? IsDir( 'C:\temp\test.bat' ) // .F. ? IsDir( 'C:\temp\Dir' ) // .F. ? IsDir( 'C:\temp\Dir*.*' ) // .T. ? IsDir( 'C:\temp\Dir1' ) // .T. ? IsDir( 'C:\temp\Dir1*' ) // .T. ? IsDir( 'C:\temp\Dir2' ) // .T. ? IsDir( 'C:\temp\Dir2*' ) // .T. ? IsDir( 'C:\temp\Dir1\test1.*' ) // .F. ? IsDir( 'C:\temp\Dir1\test1.bat' ) // .F. ? IsDir( 'C:\temp\Dir1\*.bat' ) // .F.
Seealso
Directory(), File(), IsDirectory(), HB_FileExists(), HB_FNameExists(), HB_DirExists()