I wanted to customize fopen, to allow me to access files other then the Mod folder. (for personal use, that is).
Well I decided just to make it a seperate module, and here's the code for the function:
Code:
static cell AMX_NATIVE_CALL amx_ffopen(AMX *amx, cell *params)
{
int len;
char *file = MF_GetAmxString(amx,params[1],1,&len);
char *flags = MF_GetAmxString(amx,params[2],0,&len);
FILE *fp = fopen(file, flags);
return (cell)fp;
}
Which works just fine, (The file opens/creates). But when doing "FPuts/FGets"
They fail at writing/getting data from the file. Do i have to edit the fopen in the amx core for this to work?
__________________