 |
|
Thinkosaur
|

12-20-2009
, 17:25
Re: fputs() problem
|
#5
|
Quote:
Originally Posted by grimvh2
When I use fputs() I can only save 1 line in a .ini or .cfg file.
Im using it like this
Code:
public do_savecmd(id,szNewcmd[],szOldcmd[], szType[])
{
new iFile = fopen(Path, "w");
if( !iFile )
return;
new const szData[100];
format(szData,sizeof(szData)-1, "^"%s^" ^"%s^" ^"%s^"",szNewcmd,szOldcmd, szType)
fputs(iFile, szData);
fclose(iFile);
console_print(id, "New Command : %s",szNewcmd)
console_print(id, "Old Command : %s",szOldcmd)
console_print(id, "Type : %s", szType)
}
So when I put something in the file, it goes in there. but when I want to put something new in it. It deletes the first line and puts in the new.
|
^n
edit: What about using flags "at"? Would that be correct or incorrect?
Last edited by matsi; 12-20-2009 at 17:29.
|
|
|
|