mat@emcard.UUCP (Mat Waites) (04/05/88)
Hello: I've been writing a terminal program for the c64 with power c. (or is it c power?) Xmodem is working, but there is a problem with the file I/O. The first time I open a file for reading to upload it I can read the file fine and get EOF at the end. The next time I try to upload, EOF is immediately returned. If I exit the program and re-run it, it will upload the second file ok. It appears that the end of file status is stored internally and not reset on "open". Is anyone out there doing "big" program development with this compiler? I'd like to hear your experiences/ problems. My terminal program is approx 1500 lines total broken into several files. Mat -- W Mat Waites | PHONE: (404) 727-7197 Emory Univ Cardiac Data Bank | UUCP: ...!gatech!emcard!mat Atlanta, GA 30322 |
dwl10@amdahl.uts.amdahl.com (Dave Lowrey) (04/07/88)
In article <5270@emcard.UUCP> mat@emcard.UUCP (Mat Waites) writes: > >Hello: > >I've been writing a terminal program for the c64 with >power c. (or is it c power?) > >Xmodem is working, but there is a problem with the file >I/O. > >The first time I open a file for reading to upload it >I can read the file fine and get EOF at the end. >The next time I try to upload, EOF is immediately >returned. If I exit the program and re-run it, it >will upload the second file ok. It appears that >the end of file status is stored internally >and not reset on "open". > >Is anyone out there doing "big" program development >with this compiler? I'd like to hear your experiences/ >problems. My terminal program is approx 1500 lines total >broken into several files. > >Mat > >-- > W Mat Waites | PHONE: (404) 727-7197 > Emory Univ Cardiac Data Bank | UUCP: ...!gatech!emcard!mat > Atlanta, GA 30322 | C-Power remembers the last returned status from each I/O operation. It is stored in an array, one element for each possible file number (stream). Once a "non-zero" status is returned from an I/O operation, C-Power will automatically return that status with each I/O call. There are several ways out of this. The easiest (but not the most efficient), is to close the file, and re-open it again. This can be a real pain if you are dealing with relative files, that return EOF at the end fo EACH RECORD! To fix this, I have written a pgm, using the C-assm assembler, that you call to re-set the I/O status for a particular file to zero. If you would like, I can ship you a copy. -- ------------------------------------------------------------------- "Familiarity breeds attempt" Dave Lowrey Amdahl Corp. Houston, Texas (713)-850-8828 ...!{ihnp4,cbosgd,hplabs,oliveb}!amdahl!dwl10 [ The opinions expressed <may> be those of the author and not necessarily those of his most eminent employer. ]