Hey, i use this code to copy files:
PHP Code:
public exlib_MoveFile(Handle:OldFile, FileSize, String:FileName[])
{
decl String:FileContent[1024];
decl String:NewDir[PLATFORM_MAX_PATH + 2];
new Copyed = 0;
Format(NewDir, sizeof(NewDir), "maps/%s", FileName);
new Handle:NewFile = OpenFile(NewDir, "wb");
PrintToServer("Move File %s (%i bytes) to %s ...", FileName, FileSize, NewDir);
while (Copyed < FileSize)
{
PrintToServer("Copyed %i bytes", Copyed);
Copyed = Copyed + ReadFileString(OldFile, FileContent, sizeof(FileContent));
WriteFileString(NewFile, FileContent, false);
}
PrintToServer("Copyed %i bytes", Copyed);
CloseHandle(NewFile);
CloseHandle(OldFile);
}
I'll copied a 22mb file, and it needed a lot of time (3 minutes?)
__________________