Working with Files [ HP 3000 Series 9X8LX Computer Systems Task Reference ] MPE/iX 5.0 Documentation
HP 3000 Series 9X8LX Computer Systems Task Reference
Working with Files
You have learned to log on to your account, to look at your account or
group, and to create text files. In this section, you will practice:
* using HFS syntax
* listing files
* creating a directory
* renaming files
* identifying groups
* copying files
* releasing file security
* deleting files
For the following exercises, use the FILE1 file that you created in the
previous section.
Using HFS syntax
When you log on to the system, you are in a group within an account such
as YOURGRP.YOURACCT. Files you work with, such as FILE1, can be referred
to as FILE1.YOURGRP.YOURACCT or file1.yourgrp.youracct. MPE syntax
automatically converts lowercase letters to uppercase.
With the advent of the hierarchical file system, you can also refer to a
file using the HFS syntax. That same file can be referred to as
/YOURACCT/YOURGRP/FILE1. It is the path to the file or the pathname.
NOTE To refer to an MPE file name using the HFS syntax, you must type
the name using all capital letters; otherwise, the HFS syntax looks
for the name using lowercase letters and won't locate it. HFS
syntax does not convert lowercase letters to uppercase.
/YOURACCT/YOURGRP/FILE1 = FILE1.YOURGRP.YOURACCT
The first / in the pathname refers to the level above the account and is
called the root directory. It is used as a way to reference files on the
system. See Figure 1-1 .
Figure 1-1. Location of the File That You Created
Figure 1-1 shows a picture of your file's location in the file
system. YOURACCT is one level below the root directory. You logged on
to YOURACCT and were placed into YOURGRP. Then you built a file called
FILE1. Any other files that you have in YOURGRP are also located there
with FILE1.
Listing the file
You can refer to a file using either the MPE or HFS syntax. Earlier you
created a file called FILE1.
NOTE The use of the LISTFILE command in this section is intentional.
The LISTFILE command does not recognize HFS syntax.
You can list the file with MPE syntax:
:LISTFILE FILE1.YOURGRP.YOURACCT
OR (using the exact capitalization shown)
:LISTFILE /YOURACCT/YOURGRP/FILE1
Both display the same result:
FILE1
Be careful! HFS syntax is case sensitive but MPE syntax is not. You can
type the following command, using MPE syntax in lowercase, and locate
uppercase FILE1 in YOURGRP in YOURACCT. Try it.
:LISTFILE file1.yourgrp.youracct
That's because MPE syntax upshifts everything. But because HFS syntax is
case sensitive, the following command will not find FILE1 in YOURGRP in
YOURACCT:
__________________________________________________________________
| |
| |
| :LISTFILE /youracct/yourgrp/file1 |
| A component of the pathname does not exist. (CIWARN 9053) |
| |
__________________________________________________________________
YOURACCT is not the same as youracct in HFS syntax.
Creating a directory
A directory is a work area similar to an MPE group where you can put
related files. You can create directories in your group and account.
You must precede file and directory names with ./ or / to use HFS syntax.
Dot (.) means current working directory or where you are working within
the file system. So ./ lets you use HFS syntax in your current working
directory.
:NEWDIR ./Directory1
This command creates Directory1 in your current working directory.
HFS syntax accepts the name exactly as you type it in uppercase and
lowercase, and the name can be up to 16 characters long when created
directly under a group.
Watch out! If you try to create the directory without including ./
before the name, MPE/iX treats the name as a regular MPE name. It
converts the letters to all uppercase. Try typing the following command:
__________________________________________________________________
| |
| |
| :NEWDIR Directory1 |
| File name is more than eight characters long. (CIERR 532) |
| |
__________________________________________________________________
Also notice: If you type the following command, MPE/iX creates a
directory called DIR2 (uppercase). That is because you are using MPE
syntax. Try it.
:NEWDIR dir2
In the next section, you'll learn how to list the directory.
Figure 1-2 shows a picture of the file system including the
directories that you just created.
Figure 1-2. Location of the Directories That You Created
To rename a file
To rename the file called FILE1, enter:
:RENAME FILE1, YOURFILE Return
Notice the punctuation. The comma (,) is necessary to rename a file.
Use the LISTFILE command to check that FILE1 has disappeared and that a
file called YOURFILE has appeared. Enter:
:LISTFILE Return
Your screen should look like this:
________________________________________________________________________
| |
| |
| FILENAME |
| |
| |
| |
| YOURFILE |
| |
________________________________________________________________________
To copy a file
To copy a file, use the COPY command, specifying the name of the file
that you want to copy and the name that you want the new, identical copy
to have.
To make a copy of YOURFILE, calling the new copy NEWFILE, do this:
:COPY FROM=YOURFILE;TO=NEWFILE Return
Now enter:
:LISTFILE Return
Your screen should look like this:
________________________________________________________________________
| |
| |
| FILENAME |
| |
| NEWFILE YOURFILE |
| |
________________________________________________________________________
Here is what the parameters do:
* From= tells the computer which file to copy from. This original,
from which the copy is made, is called the source file.
* To= tells the computer what to call the copy. This new file is
called the target file or destination file.
There is an easier way to use the COPY command. Try this now:
:COPY NEWFILE,DOCFILE Return
Use the LISTFILE command, and you should see the new file named DOCFILE
on your screen.
To release file security
You may want to allow another user to copy your files. In order to do
this, you must release your file to this person. This is called
releasing a file. The RELEASE command removes the security provisions
for a file. You can only release files that you have created.
To remove the security provisions of the file YOURFILE, enter:
:RELEASE YOURFILE Return
This file is now ready to be copied to another account and group.
To copy files from another group
Once your files have been released, you can move these files to other
groups. To copy a file from one group to another group:
* You must know the qualified name of the file that you want to
copy. This name is the file name with the group name, such as:
YOURFILE.PUB
or
* The owner of the file you want to copy must release that file for
you with the RELEASE command.
or
* Group security must be organized to allow you access to the group.
Do this:
:COPY YOURFILE.PUB, YOURFILE.OTHERGRP Return
Then enter:
:LISTFILE @.OTHERGRP Return
You should see a copy of the YOURFILE file.
To delete a file
Make sure that you are in your home group PUB. The PURGE command erases a
file. It erases one file at a time. If you want to erase five files,
you now need to use the PURGE command five times.
Delete the file called DOCFILE. Enter:
:PURGE DOCFILE Return
If you try to delete a file that does not exist, you get an error
message.
Try to delete the file QUIKSAND. What happens? Your screen should look
like this:
________________________________________________________________________
| |
| |
| PURGE QUIKSAND |
| |
| FILE QUIKSAND.PUB.PRACTICE NOT FOUND, NO PURGE DONE. |
| (CIWARN 383) |
| : |
| |
________________________________________________________________________
MPE/iX 5.0 Documentation