08.02.2012, 18:24
Does anyone have a custom 'fcopy' function? I was thinking of something like:
I do include some additional checks as to whether the files exist and whatnot in my version, however I'm on my phone at the moment and can't copy + paste it from my laptop haha!
Anyway; I can't seem to get these to work. They only appear to copy the first line of the file. Is there any way round this or a working fcopy function lying around? I searched the forums however any results I got were just suggestions/requests on the creation.
Thanks,
Ash
pawn Код:
stock fcopy(szOne[64], szTwo[64])
{
new szContents[256]; //Appropriate in this case, possibly make it bigger if handling larger files?
new File:f = fopen(szOne, io_read);
fread(f, szContents);
fclose(f);
f = fopen(szTwo, io_write);
fwrite(f, szContents);
fclose(f);
}
Anyway; I can't seem to get these to work. They only appear to copy the first line of the file. Is there any way round this or a working fcopy function lying around? I searched the forums however any results I got were just suggestions/requests on the creation.
Thanks,
Ash