Populate a hzString with the name of the current working directory. This function calls the GNU system function get_current_dir_name().

Return TypeFunction nameArguments
hzEcodeGetCurrDir(hzString&,)

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

Function Logic:

0:START 1:items cpDir 2:unknown 3:unknown 4:Return hzwarn(E_NOTFOUND,The current working directory has access issues) 5:unknown 6:Return hzwarn(E_NOTFOUND,The current working directory has been unlinked) 7:Return hzwarn(E_NOTFOUND,Unspecified error) 8:Dir items 9:Return E_OK

Function body:

hzEcode GetCurrDir (hzString& Dir)
{
   //  Category: Directory
   //  
   //  Populate a hzString with the name of the current working directory. This function calls the GNU system function get_current_dir_name().
   //  
   //  Arguments: 1) Dir  The hzString reference to populate
   //  
   //  Returns: E_NOTFOUND If the current directory has access issues or has been unlinked
   //     E_OK  If the operation was successful
   _hzfunc("GetCurrDir") ;
   char*   cpDir ;     //  Buffer for current working directory
   Dir.Clear() ;
   cpDir = get_current_dir_name() ;
   if (!cpDir)
   {
       if (errno == EACCES)    return hzwarn(E_NOTFOUND, "The current working directory has access issues") ;
       if (errno == ENOENT)    return hzwarn(E_NOTFOUND, "The current working directory has been unlinked") ;
       return hzwarn(E_NOTFOUND, "Unspecified error") ;
   }
   Dir = cpDir ;
   free(cpDir) ;
   return E_OK ;
}