@Capehill
Quote:
I checked dos.library autodocs but couldn't spot a function to copy some file. Is there any ?
No.
Easiest way is probably something like
STRPTR cmd = IUtility->ASPrintf("Copy CLONE BUFFER=32768 %s %s", sourcefilename, destfilename);
if (NULL == cmd)
{
error
} else {
if (0 != IDOS->SystemTags(cmd, ...))
{
error
}
IExec->FreeVec(cmd);
}
Or allocate a MEMF_SHARED buffer, for example 16 MB, fopen() source and dest files, fread()/fwrite() buffer size loop until done, fclose() source and dest files (or IDOS->FOpen()/FRead()/FWrite()/FClose() instead of the C library functions) and copy the protection bits, user/group and comment with IDOS->SetProtection(), IDOS->SetOwnerInfo() and IDOS->SetComment().