xHarbour Reference Documentation > Function Reference |
Checks if a character string contains the name of an existing directory.
IsDirectory( <cDirName> ) --> lIsDirectory
The function returns .T. (true) when the directory <cDirSpec> exists, otherwise .F. (false) is returned.
The IsDirectory() 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.
See also: | Directory(), DirChange(), DirRemove(), File(), MakeDir() |
Category: | Directory functions , File functions , xHarbour extensions |
Source: | rtl\filehb.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates return values of IsDirectory() PROCEDURE Main ? IsDirectory( "C:" ) // result: .T. ? IsDirectory( "C" ) // result: .F. ? IsDirectory( "C:\xharbour" ) // result: .T. ? IsDirectory( "C:\xharbour\Test.prg" ) // result: .F. ? IsDirectory( "." ) // result: .T. ? IsDirectory( ".." ) // result: .T. ? CurDir() // result: xHarbour\samples ? IsDirectory( "..\bin" ) // result: .T. RETURN
http://www.xHarbour.com