fwrite writes only 1 line
#1

To be honest, i have never used fwrite, I always used dini. But now I need to use it. And what I see: Every time we write anything to the file, new line replaces all the previous file content

pawn Code:
format(stringu,sizeof(stringu),"%s/%s/%f/%f/%f/%d\r\n",name,pname,x,y,z,world);
if(buildingsFile)
{
fwrite(buildingsFile,stringu);
.............
So fwrite doesnt write the string to the next line. It erases the file, and then writes the string to it.
Reply
#2

Please show me how do you open your file.
Reply
#3

io_write writes every time new line from top so if you need to write more then one line use

io_append

You can visit here and see file functions
https://sampwiki.blast.hk/wiki/File_Functions
Reply
#4

[code]
format(stringu,sizeof(stringu),"%s %s %f %f %f %d\r\n",name,pname,x,y,z,world);
[/code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)