Re: Copy File programmatically



It seems like [file] copy would be a common enough operation
that there would be a single function call to accomplish it.

man sendfile

That handles only the transport of bytes. sendfile was designed
for network operations where low latency is desired. sendfile
does not handle open, close, error conditions, semantic goofs
(such as attempting to copy a file to itself), etc. Please use
system("cp source destination"); unless there is a good reason
not to.

--

.