Re: Reading directory on two drive channels at the same time. Can it be done?

From: William Levak (wlevak_at_cyberspace.org)
Date: 2004-06-14 04:00:43

On Fri, 11 Jun 2004, Jim Brain wrote:

> I know you can read a disk directory by opening "$,P,R" for reading via 
> something like:
> 
> open 1,8,2,"$,P,R"
> 
> QUestion is, can you do this:
> 
> open 2,8,2,"$,P,R"
> open 3,8,3,"$,P,R"
> get from #2
> get from #3
> etc.?
> 
> In other words, is this an error (i.e., only one channel can be open to 
> read the directory), or is this legal?
> 
> I'm writing some code to emulate this, and I need to know if the 
> directory references should be kept at the device level, or the channel 
> level.

I've tried this on 1541, 1571, and 1581 drives and it works.

There is really no reason it should not work.  When you open a file for
reading, the drive allocates a buffer and reads the relevant sector in to
the buffer.  Reading the same sector into different buffers presents no
problem.

I also tried this with the second file opened to write, and wrote
different information to the second file while reading from the first.
This should have caused problems, but it didn't.  I got no errors, but the
second file was not written.


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.