Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!YALE.ARPA!ram-ashwin From: ram-ashwin@YALE.ARPA (Ashwin Ram) Newsgroups: comp.sys.apollo Subject: Re: Concurrency at open - (nf) Message-ID: <8711021644.AA25248@ATHENA.CS.YALE.EDU> Date: Mon, 2-Nov-87 11:44:58 EST Article-I.D.: ATHENA.8711021644.AA25248 Posted: Mon Nov 2 11:44:58 1987 Date-Received: Thu, 5-Nov-87 23:46:50 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 33 > Date: 30 Oct 87 19:34:00 GMT > From: apollo!mishkin@eddie.mit.edu (Nathaniel Mishkin) > > In article <41600002@uklirb.UUCP> joa@uklirb.UUCP writes: > >I have some difficulties using files for reading and writing at the > >same time. The problem is the following: I'd like to write to a file > >with some program and at the same time to display this file [...] > > I'm afraid you're out of luck. The DM wants "n-readers xor 1-writers" > concurrency rules and wants read access. Its desire conflicts with the > existing open your program has for write access. The DM is trying to > be a good citizen (some would say paternalistic) by ensuring that it > doesn't ever show you something that might not be the "truth". You could, of course, open a transcript window using PAD_$CREATE_WINDOW, passing it the name of the file you want to write into (and the other arguments appropriately). You can now write to this object and have the output appear in the window as well as be written to the file. I have code to do this in T (a Scheme dialect) if you want to peek at it, but it should be pretty straightforward in other languages as well. I'm not sure I understand why the DM needs nR xor 1W. When you create a copy of an edit window, don't you now have two objects (windows) that are both writing to and displaying the same file (at least conceptually)? Why could the same thing not be made to work for a window displaying a file that's being written to by another process? -- Ashwin Ram -- ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,linus,seismo}!yale!Ram-Ashwin BITNET: Ram@yalecs