Re: [cc65] fwrite disk full detection

From: Ullrich von Bassewitz <>
Date: 2012-04-22 20:19:36

On Sun, Apr 22, 2012 at 12:52:51AM +0200, Johan Kotlinski wrote:
> I was a bit surprised now that fwrite does not detect disk full. I.e.,
> FILE* f = fopen("test", "w");
> while(1 == fwrite(0xc000, 100, 1, f));
> ...will create an infinite loop. Is that a bug, or supposed to work
> like that due to hardware limitations?

It is probably a bug.

Does anybody know how the disks on the serial bus flag a "disk full"
condition? Or other errors? fwrite uses write which in turn uses BSOUT. Errors
are checked by looking at the carry flag on return from BSOUT. This might be
wrong - cbm_write checks the result of READST instead.



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Apr 22 20:19:46 2012

This archive was generated by hypermail 2.1.8 : 2012-04-22 20:19:50 CEST