[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Profile operations from command line.



JCarlson <jcarlson1701@gmail.com> wrote:

> In article
> <1i4hwt0.3yzite7yvfz5N%dempson@actrix.gen.nz>dempson@actrix.gen.nz
> (David Empson) wrote:
> >  You probably also want to learn about subdirectories and the prefix
> > command. You need to use subdirectories if you want to store a
> > moderate number of files on anything larger than a 5.25" floppy.
> 
> Do you know where I can get such documentation?

Not offhand. There were lots of books back in the day, including
standard ones supplied with the Apple IIe in the ProDOS era which
covered simple things like this, or Apple's "BASIC Programming with
ProDOS" which went into more detail.

Here is a summary.

Each volume, directory or file has a name which starts with a letter,
and contains up to fifteen letters, digits or periods.

All mounted volumes must have unique names to avoid problems.

The top level of a volume is called the "root directory". On a standard
ProDOS volume, it can contain a maximum of 51 files or directories.

The term "subdirectory" is used to refer to a directory inside another
one.  (The root directory on a volume is the only one which cannot be
regarded as a subdirectory.)

A subdirectory can contain a large number of files and further
subdirectories (which can themselves have yet more files and
subdirectories, etc.)

In theory, the number of files and directories in a subdirectory is only
limited by the size of the volume, but some applications have an
arbitrary or practical limit, so it is a good idea to keep your
subdirectories down to a moderate number of files and subdirectories
(e.g. 100).

You can refer to any file on a volume using a "pathname". A full
pathname starts with a slash ("/"), followed by the volume name, then
another slash, then the subdirectory or filename. This pattern repeats
for each subdirectory in the hierarchy.

e.g. if you have volume called "PROFILE" with a subdirectory "BASIC"
with a file "TEST" then its full pathname is:

/PROFILE/BASIC/TEST

A file in the root directory might be:

/PROFILE/PRODOS

(Note that I'm only using "PROFILE" as an example - you can call your
ProFILE drive anything you like.)

ProDOS imposes a limit of 63 characters on the total length of a
pathname, so you can always go at least two directories deep, and can go
deeper if you use shorter names for your volume, directories and/or
files.

You can always refer to a file by typing in its full pathname. This gets
tedious if you are working in a subdirectory, so BASIC.SYSTEM (and
ProDOS) lets you set a prefix, which saves you having to type in the
volume name and subdirectory name each time.

You can set the prefix using the PREFIX command, specifying a pathname
to a volume or a specific directory.

e.g.

PREFIX /PROFILE/BASIC

After doing this, you can refer to a file just using its name, e.g. RUN
TEST.

You can also use a partial pathname, which contains a directory (or
multiple directories) and filename, separated by slashes, but without
the leading slash. The prefix is added to the front.

For example, if you type:

PREFIX /PROFILE

then you can refer to the above file using

RUN BASIC/TEST


Some other variants:

PREFIX

(with no arguments) will display the current prefix. If you haven't set
a prefix ("slot and drive" mode), it will read the disk in the current
drive and display its name.

PREFIX -

will clear the prefix, returning BASIC.SYSTEM to "slot and drive" mode.
(I hope I have this one right - It might be "PREFIX /". Haven't used it
for a while.)

PREFIX,Sn,Dn

will set the prefix to the name of the volume in the specified slot and
drive. Watch out if using this with a removable volume - if you swap
disks, a bare filename or partial pathname (or even a simple command
like CAT) will go looking for the missing volume and if it can't find it
you will get a VOLUME NOT FOUND error.

-- 
David Empson
dempson@actrix.gen.nz