HP3000-L Archives

November 2002, 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:
John Clogg <[log in to unmask]>
Reply To:
John Clogg <[log in to unmask]>
Date:
Wed, 27 Nov 2002 11:59:53 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (66 lines)
Peter,
Most file access is with permanent files.  Probably the most typical
scenario is to build a file with the BUILD command, and then access it with
your program.  As you have seen, you can create the file with an FOPEN,
which places it in the NEW domain, which simply means that it is not added
to the directory.  When you close a NEW file, it will be deleted, unless you
specify a disposition of TEMP or SAVE.  A TEMP file is also not cataloged in
the system directory, and is therefore known only to the job or session that
created it.  It will be deleted at the end of the job or session unless it
is SAVEd.  No temporary copy is made when access permanent files.  They are
identical to NEW or TEMP files except for their disposition.

Here's an interesting fact that help illustrate file disposition.  The PURGE
command accomplishes its function by opening the file and then closing it
with a disposition of DELETE.  You can modify its behavior as follows:

 :FILE MYFILE;SAVE
 :PURGE *MYFILE

This will not delete the file, because the disposition specified in the FILE
command overrides the default disposition.  It will empty the file, though,
because it opens the file for write access, which places the EOF pointer at
the beginning of the file.  This is a convenient way to empty a file.  If
you did the same thing, but added ACCESS=APPEND to the FILE command, the
file would not be emptied.  To make things even more confusing, you can
actually build a file with PURGE:

 :FILE MYFILE,NEW;SAVE;REC=-80,,1,f,ascii;disc=5000
 :PURGE *MYFILE

Probably more than you wanted to know!

John

-----Original Message-----
From: Peter Smithson
[mailto:[log in to unmask]]
Sent: Wednesday, November 27, 2002 10:17 AM
To: [log in to unmask]
Subject: Newbie question about file domains and FOPEN/FCLOSE intrinsics


 From the manual and some experience with MPE I realise that when I
create a new file it goes into the "new file domain" and can be put
into the "permanent domain" with the FCLOSE statement.

But reading about FCLOSE and some of the options makes me wonder what
happens when you FOPEN an existing permanent file.  At the point of
opening, is some sort of copy made to the new file domain?  So when
the FCLOSE happens the new copy can be made back to the original file?

Or does it just work with the file in the permanent domain once it's
there?

Sorry if this is a very basic question.
--
http://www.wadmag.org.uk - Windsor & District MAG
http://www.nmmcc.co.uk - Non-Members MCC
http://uk.geocities.com/ukwebring - UK Motorcycle site webring

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

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

ATOM RSS1 RSS2