Determine if a directory exists at the supplied pathname.

Return TypeFunction nameArguments
hzEcodeDirExists(const char*,)

Declared in file: hzDirectory.h
Defined in file : hzDirectory.cpp

Function Logic:

0:START 1:unknown 2:Return E_ARGUMENT 3:unknown 4:Return E_NOTFOUND 5:unknown 6:Return E_TYPE 7:Return E_OK

Function body:

hzEcode DirExists (const char* dirname)
{
   //  Category: Directory
   //  
   //  Determine if a directory exists at the supplied pathname.
   //  
   //  Arguments: 1) dirname  The full pathname of the anticipated file
   //  
   //  Returns: E_ARGUMENT If the pathname was not supplied
   //     E_NOTFOUND If the directory does not exist
   //     E_TYPE  If the supplied pathname is not that of a directory
   //     E_OK  If the directory exists
   FSTAT   fs ;        //  Directory status
   if (!dirname || !dirname[0])
       return E_ARGUMENT ;
   if (stat(dirname, &fs) == -1)
       return E_NOTFOUND ;
   if (!S_ISDIR(fs.st_mode))
       return E_TYPE ;
   return E_OK ;
}