HP3000-L Archives

November 2002, 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:
Tom Emerson <[log in to unmask]>
Reply To:
Tom Emerson <[log in to unmask]>
Date:
Mon, 18 Nov 2002 10:34:35 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (42 lines)
On Monday 18 November 2002 08:17, Peter Smithson wrote:
>  I don't know much about the basics of MPE but I'm trying to understand
> an application that runs on MPE.

The first basic concept you have to learn is that under MPE, files are
*typically* record oriented from the get-go [using posix or "c-library"
semantics, you can use byte-oriented or "stream" mode files, but this is not
the usual case yet]

> I'd like to know if it uses direct or sequential access to a file but
> I can't see how the two access methods are used.  I couldn't see a
> flag on FOPEN or on the BUILD command.  So how do you open a file for
> sequential or direct access?

you don't control that behaviour this way -- since "all files" are record
oriented, FOPEN always opens them with some idea of the record size.  The
FREAD intrinsic reads the next available record (in effect, defaulting to
sequential access).  To MOVE to another record (i.e., "direct access") you
use the FREADDIR intrinsic to read a specific record, or FSEEK to point to
the record you want prior to reading it.

> Also, FDELETE will delete a record from a RIO file.  How do you delete
> a record from a direct access standard file?

The simple answer is "you don't" (and even for RIO files, the record doesn't
actually get "deleted" in the sense that the bytes-on-disk are moved around;
instead, the system marks the record as "deleted" so that on subsequent
reads, the system ignores the record...)  Logically, you would do the same
thing in your own application (create some sort of sentinal value that your
program interperets as "this record has been deleted", and alter processing
accordingly)  To physically remove records (move bytes-on-disk around to fill
the holes) you would have to copy the contents of all the records you want to
keep to a new file...


> Thanks
>
> Peter

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2