Copy a directory
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | Dircopy | (hzString&,hzString&,bool,) |
Declared in file: hzDirectory.h
Defined in file : hzDirectory.cpp
Function Logic:
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 ;
}