Re: [cc65] Probleme mit File-IO ( die 2te )

Date view Thread view Subject view

From: Marc 'BlackJack' Rintsch (marc_at_rintsch.de)
Date: 2001-08-25 10:14:53


Hi udo,

> Hi Mark,

Grrrr... Mar_c_!

> > BTW why are you checking rc<2 ? Every value except 0 is an error.
>
> cbm_read returns the numbers of bytes read, not an errorcode only.

Yeah, me stupid. I confused that because you used the variable name 
'rc' in in the Open* functions and I missed that it's the return value 
of cbm_read in this case.

> I am expecting to read an integer, so rc=2 is the only valid
> response.

Hm, I guess the really correct check would be (rc<sizeof(int)) then ;-)

> The missing file close i detected also this afternoon.
> But even with the correction the programm only works for the first
> storing of adress.

No it doesn't work for the first storing! How the heck do you do test 
runs? Take a look at the drive LED - it stays on. You don't close the 
file after writing to it. You are opening the file with the logical 
file number A_FNW but at the end you call cbm_close() with A_FNR.

A look at the directory should have revealed this too.

Maybe you should use (better|more readable) names for your constants.

Ciao,
	Marc 'BlackJack' Rintsch
-- 
"Do you trust one company to decide the future? Chose Linux!"
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:41 CET