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

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2013-01-03 21:07:42
Hello,

* On Tue, Jan 01, 2013 at 04:10:29PM +0100 silverdr@wfmh.org.pl wrote:
> 
> On 2012-09-24, at 10:05, Oliver Schmidt wrote:
> 
> >> Even
> >> worse, the routine is so much confused because other variables have been
> >> rewritten that it even outputs the directory header again.
> > 
> > Just to be sure - this is an issue specific to the directory read
> > routine. It is in general possible to successfully open several files,
> > right?
> 
> Shame to say how many years already I always thought so ;-)

Why? Your example is no counter-example. ;)

> 10 open 1,8,2,"textfile,s,r"
> 15 open 2,8,15
> 17 close2

Here, the close is the problem. Closing the command/error channel is a special
case in the floppy, which interferes with your open file.

IIRC, closing the command channel results in closing all open channel in
the floppy (I would have to confirm it, but I am almost sure that this
was the case).

Thus, the solution: Never ever close the command channel.

egards,
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 Thu Jan 3 21:37:00 2013

This archive was generated by hypermail 2.1.8 : 2013-01-03 21:37:05 CET