[comp.sys.apple2] Opening a ProDOS file read-only twice

rat@madnix.UUCP (David Douthitt) (06/09/90)

sb@pro-generic.cts.com (Stephen Brown) writes:
| 
| Also, in the discussion about the OPEN (open a file) MLI call, it says "more
| than one OPEN may be issued to the same file is the file's access is WRITE
| disabled (read only file)".  Why would you possibly OPEN the same file more
| than once?

I came up with a reason a while back.  I was considering writing a sort
of device-sharing / file-sharing set up.  I own a II+ and a IIc, and it
hurts to have all those disk drives on one computer or the other.

I was thinking of writing a CP/M driver to allow a serial port transmission
to look like a disk, and to let the IIc handle serial port transmissions
as block requests to the 3.5" drives.  This would give CP/M 800K of disk
space for each disk (since then, my CP/M now supports 3.5" disk directly...
but STILL).

So... consider the case where I want to open a file on the CP/M side,
then somewhere along the way, someone wants to open the same file on
the ProDOS side.  If both open it for writing, chaos could ensue...
I write, then you overwrite what I just wrote with something else.  NOT
good.

On the other hand, if the file is opened for reading only by two
people, everything should work okay.

And, NO, I never wrote such a program...

	[david]

-- 
! InterNet: madnix!rat@cs.wisc.edu              !  David Douthitt
!     UUCP: ...uwvax!astroatc!nicmad!madnix!rat !  Madison, Wisconsin
!                {decvax!att}!                  !  === Apple II Forever ===
! Thimpk before you post...!                    !  The Stainless Steel Rat