[Filesystem] fwrite shows in file something like 0☺? or j¶
#1

Hi,

i've got a problem with the filesystem.
Even it wrote in the file, it save something like "0☺?" or "j¶".

...

Why?
Reply
#2

Maybe try
pawn Code:
format(file_new_content, sizeof(file_new_content),"%d", file_temp_content);
instead of
pawn Code:
format(file_new_content, sizeof(file_new_content),"%i", file_temp_content);
Reply
#3

Quote:
Originally Posted by Marcel
Maybe try
pawn Code:
format(file_new_content, sizeof(file_new_content),"%d", file_temp_content);
instead of
pawn Code:
format(file_new_content, sizeof(file_new_content),"%i", file_temp_content);
Thanks for answer, but it's still the same.
I test it on windows xp (german). Maybe a charset-bug?
Reply
#4

What program are you opening the file with?
Reply
#5

Standard MS Editor.
But if i write "print(file_new_content);" it still show the same special chars like in the Editor.
(No, i don't save in the editor.. just open, show, close(without saving)).
Reply
#6

1. You check with !fexist() that the file DOES NOT exist and then you try to open the file THAT DOES NOT exist? Makes perfect sense.
2. You don't give the mode that you want to open the file with.
3. READ WIKI, SO YOU MIGHT KNOW HOW TO USE THE FUNCTION NEXT TIME.

PS. Marcel, %d and %i are the same thing.
Reply
#7

Quote:
Originally Posted by Finn
1. You check with !fexist() that the file DOES NOT exist and then you try to open the file THAT DOES NOT exist? Makes perfect sense.
That make sence, cause it create a new file

Quote:
Originally Posted by Finn
2. You don't give the mode that you want to open the file with.
Not necessary because io_readwrite is defined as default.

I read it Pls no capslock!



But i fixed it now.
Have to look like this.
...
Reply
#8

Well, you can ignore the first comment, because I didn't know it will create the file automatically.

If it works, good luck with it. :P
Reply
#9

Quote:
Originally Posted by Finn
because I didn't know it will create the file automatically.
But refer to wiki *g*

What ever...thanks for help.
Reply
#10

What the fuck?

I thought you must define the mode, so because you didn't define it, I thought it's bugged. Then you said readwrite is the default define and I told you to ignore what I said cuz I didn't know it has any default defines. Wiki does not say anything about readwrite being the default define. What is so hard to understand?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)