Return Type | Function name | Arguments |
---|---|---|
hzEcode | Filemove | (const hzString&,const hzString&,) |
Declared in file: hzDirectory.h
Defined in file : hzDirectory.cpp
Function Logic:
Function body:
hzEcode Filemove (const hzString& src, const hzString& tgt) { _hzfunc(__func__) ; FSTAT fs ; if (!tgt || !src) return E_ARGUMENT ; if (lstat(src, &fs) < 0) return E_NOTFOUND ; if (S_ISDIR(fs.st_mode)) return E_TYPE ; if (lstat(tgt, &fs) == 0) { if (S_ISDIR(fs.st_mode)) return E_TYPE ; return E_DUPLICATE ; } if (rename(*src, *tgt) < 0) return E_WRITEFAIL ; return E_OK ; }