YedFileMan - Copy

NAME:
Copy

SYNOPSIS:
SINT Copy(void *pvO,SCHAR *pscSource,SCHAR *pscDest,SINT siFlag);

DESCRIPTION:
The method copies pscSource in pscDest, according to siFlag content. siFlag is a bit mask, whose single bits can combined in OR mode to reach the target. If siFlag is 0, the default operation is the copy of pscSource in pscDest with overwriting control.
The values you can put in OR mask in siFlag are:

YF_OVERWRITE
destination always overwritten

YF_HARDLINK
pscDest is an hard link to pscSource ( see also link(2))

YF_SYMLINK
pscDest is a symbolic link to pscSource ( see also symlink(2))

YF_BACKUP
in case of copy, create a backup of pscDest if it already exists. The backup file name is the same of pscDest, with suffix '˜y'

YF_PRESERVE
if possible, pscDest will preserve user ID, group ID, permissions and times of pscSource.

YF_FORCESYNC
After copying, force syncing of device involved in the operation.
WARNING: using this value is not a 100% warranty of phisic writing.

Combining values YF_FORCESYNC or YF_PRESERVE with values YF_HARDLINK or YF_SYMLINK does not have any effect.

pvO is the instance of the object invoking the method.

RETURN VALUE:
The method returns YFSUCCESS in case of correct termination. Else, it returns:

YFSIZEINVALID
pscSource or pscDest buffer length is greater than MAX_SIZE_NAME

YFSOURCENOTEXIST
pscSource is non-existent.

YFGENERALERROR
Generic error: read errno value for more details

YFINVALIDSOURCE
pscSource is a directory

YFDESTEXIST
pscDest exists, and the method has been invoked without enabling destination overwriting

YFWRITEERROR
Writing error in pscDest

YFREADERROR
Reading error in pscSource

YFOPENERROR
Error in opening file.

YFNOCASE
siFlag bit mask has invalid values.


http://yed.sourceforge.net