//copyf - copy file or folder with content :int copyf(dword from1, in1) { dword error; BDVK CopyFile_atr1; if (!from1) || (!in1) { notify("Error: too less copyf params!"); notify(from1); notify(in1); return; } if (error = GetFileInfo(from1, #CopyFile_atr1)) { debug("Error: copyf->GetFileInfo"); return error; } if (isdir(from1)) return CopyFolder(from1, in1); else return CopyFile(from1, in1); } :int CopyFile(dword copy_from3, copy_in3) { BDVK CopyFile_atr; dword error, cbuf; if (error = GetFileInfo(copy_from3, #CopyFile_atr)) { debug("Error: CopyFile->GetFileInfo"); } else { cbuf = malloc(CopyFile_atr.sizelo); if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3)) { debug("Error: CopyFile->ReadFile"); } else { if (error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3)) debug("Error: CopyFile->WriteFile"); } } free(cbuf); if (error) debug_error(copy_from3, error); return error; } :int CopyFolder(dword from2, in2) { dword dirbuf, fcount, i, filename; char copy_from2[4096], copy_in2[4096], error; if (error = GetDir(#dirbuf, #fcount, from2, DIRS_ONLYREAL)) { debug("Error: CopyFolder->GetDir"); debug_error(from2, error); free(dirbuf); return error; } if (chrnum(in2, '/')>2) && (error = CreateDir(in2)) { debug("Error: CopyFolder->CreateDir"); debug_error(in2, error); free(dirbuf); return error; } for (i=0; i