[A89] files and AMS 2.05


[Prev][Next][Index][Thread]

[A89] files and AMS 2.05




I've upgraded to AMS 2.05, and after a minor struggle, everything seems
to be working.  Except this:

<code>
//open file and check for errors
file_ptr = fopen("orbsave", "rb");
if(ferror(file_ptr))
{
fclose(file_ptr);
FontSetSys(F_6x8);
clrscr();
puts("\n\n\n\n\n\n   Error Opening File.");
FontSetSys(F_4x6);
GKeyIn(NULL, 0);
return params;
}
</code>

The if statement doesn't execute if the file doesn't exist.  Instead the
program crashes with a "protected memory violation" error when it tries
to read from the file.  If the file does not exist, ferror() = FALSE; if
the file exists, ferror() = FALSE.  This had no problems with AMS 1.00.

Also, is there a way to put page break chars in a text file using
something like fputc() when the file is opened using text mode? 
Alternatively, how do I append a text file opened in binary mode (I
assume that when I append it, I'm not writing over the TEXT_TAG, so TIOS
thinks that the file hasn't changed)?

Jon K.
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.




Follow-Ups: