Command Prompt for Windows




filecpy, _wfilecpy, _tfilecpy

__int64 filecpy(char *dst, char *src, int o_flag, int u_flag);
__int64 _wfilecpy(wchar_t *dst, wchar_t *src, int o_flag, int u_flag);
__int64 _tfilecpy(TCHAR *dst, TCHAR *src, int o_flag, int u_flag);

Copies the source file to the destination file.

Parameter Description
dst Address of a NULL terminated character string containing the path of the destination file. This path can be relative or absolute and can NOT contain wildcard characters.
src Address of a NULL terminated character string containing the path of the source file. This path can be relative or absolute and can NOT contain wildcard characters.
o_flag Value which specifies how to open the destination file. These values are #defined in the WOIO.H header file and include:-

O_OPEN Open the destination file.

O_CREATECreate the destination file. When the destination file already exists then it is truncated to 0 length.

O_CREATNEWCreate the destination file. When the destination file already exists then filecpy() will fail.

These values can NOT be combined.

u_flag Value which specifies how to update the status bar percentage. These values are #defined in the WOIO.H header file and include:-

INC_BYTE Increment by the size of the source file.

INC_ONE Increment by a value of 1 only.

INC_NONE Do not update.


Returns

On success, it returns the number of bytes copied to the destination file. On error a value of -1 is returned.

Comments

On error, filecpy() displays one of the following error messages:-

Out of memory

Invalid path or file name

Destination file already exists

Read error

Insufficient disk space

See Also

filesize, filencpy, filecat, filencat