Copy a directory

Return TypeFunction nameArguments
hzEcodeDircopy(hzString&,hzString&,bool,)

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_CORRUPT 7:rc 8:unknown 9:Return rc 10:Return rc

Function body:

hzEcode Dircopy (hzString& tgt)hzString& src, bool bRecurse, 
{
   //  Category: Directory
   //  
   //  Copy a directory
   //  
   //  Arguments: 1) tgt   This must specify a directory that either exists or can be created
   //     2) src   This must specify a directory that exists.
   //     3) bRecurse If set, the directory copy will be recursive.
   //  
   //  Returns: E_NOTFOUND If the specified source directory cannot be found.
   //     E_TYPE  If the either the specified source or target is not a directory.
   //     E_WRITEFAIL If the target directory cannot be asserted or a file could not be created or written.
   //     E_EXCLUDE If file system permissions were the cause of (3)
   //     E_OK  If the operation was fully successful
   FSTAT   fs ;            //  Directory entry status
   hzEcode rc = E_OK ;     //  Return code
   if (!tgt || !src)
       return E_ARGUMENT ;
   if (lstat(src, &fs) == -1)
       return E_NOTFOUND ;
   if (!S_ISDIR(fs.st_mode))
       return E_CORRUPT ;
   rc = AssertDir(tgt, (uint32_t) 0777);
   if (rc != E_OK)
       return rc ;
   return rc ;
}