xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

IsDirectory()

Checks if a character string contains the name of an existing directory.

Syntax

IsDirectory( <cDirName> ) --> lIsDirectory

Arguments

<cDirName>
This is a character string holding the relative or absolute name of a directory.

Return

The function returns .T. (true) when the directory <cDirSpec> exists, otherwise .F. (false) is returned.

Description

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.

Info

See also:Directory(), DirChange(), DirRemove(), File(), MakeDir()
Category: Directory functions , File functions , xHarbour extensions
Source:rtl\filehb.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe