HP3000-L Archives

June 1995, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jerry Fochtman <[log in to unmask]>
Reply To:
Date:
Mon, 26 Jun 1995 21:14:00 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (75 lines)
From: Denys Beauchemin <[log in to unmask]>
> May I ask why you do not use the COPY keyword during the copy which prevents
> the record in the circular file from being flushed.  I believe this might
> save you a step.  But then again, circular files are not in my area.
 
The COPY keyword applies only to message (IPC) files.  A basic property of
message files is once read, the record is automatically 'deleted' from the
file.  The COPY keyword 'overrides' this feature such that when read, the
record remains in the message file.  This option has no bearing on CIRCULAR
type files to my knowledge.
 
 
From: John Beckett <[log in to unmask]>
[...snip...]
 
> 2. Because I _want_ it to be flushed at that point, else when I copy back
>    in I'd find that I had two copies of all the records I hadn't edited.
 
[...snip...]
 
To essentially copy the data back to a circular file and 'replace' the
current contents of the file, use the "ACC=OUT" option on a feq:
 
:FILE OUT=CIRCFILE,OLD;ACC=OUT;EXC
:FCOPY FROM=workfile;TO=*OUT
 
The 'ACC=OUT' option basically tells the file system to start writing to the
file at record #0.  Upon close, the file pointer is set to the last record
of the file.  Without getting into dealing with the file blocks allocated
but not currently used beyond the EOF, this should work....I've tested it
as follows:
 
BUILD TEST1;REC=-80,16,F,ASCII;CIR
FCOPY FROM=;TO=TEST1
LINE 1
LINE 2
LINE 3
LINE 4
LINE 5
^Y
 
:LISTF TEST1,2   (SHOWS EOF AT 5)
 
FILE OUT=TEST1,OLD;ACC=OUT
FCOPY FROM=;TO=*OUT
LINE 1
^Y
 
:LISTF TEST1,2  (SHOWS EOF AT 1)
 
However, I believe you'll need EXCLUSIVE access to the file in order to
effective do this as it seems to me that CIRCULAR files a GMULTI files, thus
sharing the file control block info amoung all processes with the file
open.
 
 
From: John Dunlop <[log in to unmask]>
 
> I have been told about another way to edit circular files, e.g. issue a
> file command with the ;COPY option :
>
>        FILE CIR=CIRCULAR;COPY
>        RUN QEDIT.PUB.ROBELLE;PARM=9;INFO="T *CIR"
>
> This seems to work okay even if two processes edit the file at the same
> time !
 
I tried what John said, and indeed the only way this would work is using
QEDIT and including the ";COPY" keyword.  Checking HP's manuals, ";COPY"
is only discussed in reference to MESSAGE files.  Perhaps QEDIT is doing
something not obvious.... anyone from Robelle lurking about care to
comment or share their insight....?
 
-- Jerry (back from vacation and trying to catch-up...) Fochtman

ATOM RSS1 RSS2