Re: Cursory analyses of CBM readdir bug (was: [cc65] Re: readdir bug)

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2013-01-11 07:34:20
Hello,

* On Fri, Jan 11, 2013 at 03:13:27AM +0100 silverdr@wfmh.org.pl wrote:
> 
> On 2013-01-11, at 03:09, silverdr@wfmh.org.pl wrote:
> 
> >>> Thus, the only way to find out if the OPEN was successfull is to read
> >>> the error channel, or (much easier): read the first byte. If the OPEN
> >>> was not successfull, READST will return 0x42 (0x40 = EOF, 0x02 = time
> >>> out).
[...]

> > I think Spiro referred to reading first byte off the status channel. Only '0' as the first character of status string denotes success. All actual errors start from 20 ('2' as first byte) upwards. This means you have to open and read the status channel anyway. Only a bit faster.
> 
> Or not - I think I misunderstood reading the first time - it's late already..

Yes, you misunderstood. ;)

10 OPEN 1,8,2,"DOESNOTEXIST,S,R"
20 GET#1,A$
30 PRINT ST

will return 66.

Now, create the file "DOESNOTEXIST":

OPEN 1,8,2,"DOESNOTEXIST,S,W": CLOSE 1

and re-run. Now, watch the difference...

Regards,
Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Jan 11 07:34:54 2013

This archive was generated by hypermail 2.1.8 : 2013-01-11 07:34:59 CET