>I'm using "FILE" function to write an array in a file and in this way I see
>that when is present a line feed (10) the function automatically insert a
>carriage return(13). This cause an error when i try to read the file. I would
>like to know why this carriage return is inserted and if is possible to
>prevent this.
When you open the file to write to it, ensure you open it in binary
mode rather than text mode (which translates /n to /r/n)
>Another question about "FILE" function is that when I open and
>read this file the function read only a little number of bytes and stop
>itself like it meet an EOF. That isn't an EOF but the Exadecimal 1A byte.
0X1A is the EOF character - again it sounds like you're opening the
file in text mode.
Dave
james - 01 Jul 2005 13:39 GMT
> >I'm using "FILE" function to write an array in a file and in this way I see
> >that when is present a line feed (10) the function automatically insert a
[quoted text clipped - 13 lines]
>
> Dave
I open the file with "a+" parameter to write and "r" parameter to read.
I've tried to open the file as binary but it return an error. In anyway I'll
try that again.
Can you tell me why if I read the file with "FILE*" procedure the EOF is
recognised with 0X1A and if I read the file with "CFile" procedure the EOF is
at the real end of file?
Thank you
David Lowndes - 01 Jul 2005 17:48 GMT
>I open the file with "a+" parameter to write and "r" parameter to read.
>I've tried to open the file as binary but it return an error.
I don't see why opening the file as binary should cause an error.
>Can you tell me why if I read the file with "FILE*" procedure the EOF is
>recognised with 0X1A and if I read the file with "CFile" procedure the EOF is
>at the real end of file?
Probably because one is in text mode and the other isn't?
Dave