Command Prompt for Windows




filencpy, _wfilencpy, _tfilencpy

__int64 filencpy(char *dst, char *src, __int64 num, __int64 offset, int o_flag, int u_flag);
__int64 _wfilencpy(wchar_t *dst, wchar_t *src, __int64 num, __int64 offset, int o_flag, int u_flag);
__int64 _tfilencpy(TCHAR *dst, TCHAR *src, __int64 num, __int64 offset, int o_flag, int u_flag);

Copy a part of 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.
num Value specifying the number of bytes in the source file that should be copied to the destination file. A value of -1 indicates that all the remaining bytes in the source file, taking into account the starting offset, should be copied.
offset Value specifying an offset into the source file, where characters will be read from, The first byte in the source file is located at offset zero.
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 filencpy() 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, filencpy() displays one of the following error messages:-

Out of memory

Invalid path or file name

Destination file already exists

Out of range

Seek error

Read error

Insufficient disk space

See Also

filesize, filecpy, filecat, filencat