HP3000-L Archives

December 1998, Week 3

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:
Larry Boyd <[log in to unmask]>
Reply To:
Date:
Wed, 16 Dec 1998 10:51:14 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
In <[log in to unmask]> [log in to unmask] writes:

> Circular files ...
> Ok I understand the principle of the circular file and I intend
> to use it
> for updating stats reports for users.
> Only one problem, new info is added at the bootom end of the
> file and the
> old info is squeezed out at the top.
>
> I would like the newest info to be at the top.
>
> Anyone know a smart way of doing this without a SORT?

Do you mean you want the newest info "at the top" or do you just want to
access it first?  Many, many moons ago I did something similar with a
standard flat file.  When you read the file, position the record pointer to
the eof, read, delete, move backwards until you're done.  Then reset the
eof, close file and wait for more records.

Now, this wasn't as good as a message file because you could post a read to
the file when there were no records.  The read program will just wait until
a record is there.  In the flat file example, your read program will need to
pause (unless it's actually just running every day or something) for a few
seconds and check the eof.  If there are records, it processes, otherwise it
goes back to sleep.

I haven't needed to do this in more than 10 years, so I'm guessing there is
a better way today.  MPE has gone through *many* changes in the last 10
years, so there's probably a better solution now.

lb

ATOM RSS1 RSS2