[Info-vax] Multiple File Readers/Writers
Matt
matt-nospam at 9track.net
Fri Nov 25 04:18:05 EST 2011
On 25/11/2011 07:43, chrisj.doran%proemail.co.uk at gtempaccount.com wrote:
>
> Sorry, forget what I said; I must have been thinking of some other
> problem/system. As you say, the problem is in the reader, as DUMP
> shows the file changing.
>
> I note that my (rather old) manual says that "file sharing is not
> supported for stream files" but setting ctx=rec doesn't help. Nor does
> turning off buffering with setvbuf. I've tried various other things,
> but still can't get it to work. I'll keep thinking.
>
> Maybe there's a better way to sync. ISTR that when I needed to do
> something similar, I checked the last update time of the file.
>
> I found a couple of buglets, though: You've omitted the mode argument
> to open which results in funny file protection, and tested fd instead
> of rc after lseek() and read(). But these don't affect the problem.
>
> Chris
Yes, it's like it's reading from some buffer somewhere. I've passed the
GBC option so it should be using a single global buffer shared between
the two processes.
The Guide to OpenVMS File Applications manual
(http://h71000.www7.hp.com/doc/731final/4506/4506pro.html) says that
sharing is supported for all file organisations although I think with
multiple writers on stream files you have to provide your own locking
mechanism. It also hints that you may need to maintain the EOF pointer
manually.
Thanks for the bug fixes - good old copy/paste. The C-RTL manual doesn't
show a mode parameter for open() when using the 'HP C extension' format.
I'll have to check the headers to see if this is a typo in the manual or
if the file protection needs to be passed as one of the RMS parameters.
Matt
More information about the Info-vax
mailing list