native fclose () problem!
#1

I have this error "#0 native fclose () from samp03svr" from crashdetect on my server log.
I am not quite sure what is the problem here.. I've search for this problem and find similar problem to my problem but didn't work very well so I think, I should start new thread.

pawn Код:
stock AppendTo(filename[],string[])
{
  if(!fexist(filename))
  {
    new File:myfile=fopen(filename,io_write);
    fclose(myfile);
  }
  new File:myfile=fopen(filename,io_append);
  new timestring[MAX_STRING];
  if(strcmp(filename,"phones.ini",true)==0)
  {
      format(timestring,sizeof(timestring),"%s",string);
      fwrite(myfile,timestring);
      fclose(myfile);
      return 1;
  }
  if(strcmp(filename,"commands.log",true)==0)
  {
      format(timestring,sizeof(timestring),"%s\n",string);
      fwrite(myfile,timestring);
      fclose(myfile);
      return 1;
  }
  new hour,minu,seco,giorno,mese,anno;
  gettime(hour,minu,seco); getdate(anno,mese,giorno);
  format(timestring,sizeof(timestring),"[%d:%d:%d/%d-%d-%d]%s\n",hour,minu,seco,giorno,mese,anno,string);
  fwrite(myfile,timestring);
  fclose(myfile);
  return 1;
}
pawn Код:
stock Debug(string[])
{
  SendClientMessageToAdmins(string,COLOR_GREEN);
  print(string);
  new newstring[MAX_STRING]; format(newstring,sizeof(newstring),"%s\n",string);
  if(!fexist(debuglog))
  {
    new File:myfile=fopen(debuglog,io_write);
    fwrite(myfile,newstring);
    fclose(myfile);
  }
    new File:myfile=fopen(debuglog,io_append);
    fwrite(myfile,newstring);
    fclose(myfile);
  return 1;
}
Edit:
It work very well with windows (.dll plugins) but not with Linux (.so plugins even though all plugins work very well and loaded as well)

Edit: Fixed
Reply
#2

Linux is case sensitive,make sure the file name is right.
for example,the file name should be commands.log not Commands.log.
Reply
#3

Nope, still same.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)