lotus

previous page: 06.032 What is the default volume and folder (directory) when ProDOS boots?
  
page up: Apple II Csa2 FAQs
  
next page: 06.034 How can I discover the volume name of a just booted disk?

06.033 How can I set default volume and folder (directory) under ProDOS?




Description

This article is from the Apple II Csa2 FAQ, by Jeff Hurlburt with numerous contributions by others.

06.033 How can I set default volume and folder (directory) under ProDOS?

         The ProDOS PREFIX command followed by a pathname lets you set the default
volume and folder (or directory) by name-- i.e. you set the default pathname
prefix.  For example,

PREFIX /NARF

or, in a BASIC program

100 PRINT CHR$(4)"PREFIX /NARF"

tells your computer to find the ProDOS volume (e.g. disk, hard disk partition,
etc.) named "NARF" and, once it is found, set the current default directory to
/NARF/-- i.e. the main or "root" directory of the volume named "NARF". From
then on, commands like CAT, RUN GRAFIX, BLOAD STARTPIC, etc. automatically
reference /NARF's main directory.

     If you enter CAT PAINTERS/, ProDOS will go to the PAINTERS/ folder on /
NARF and display a CATALOG of the folder's contents.

     If you move your /NARF diskette to a different drive and do a CAT, ProDOS
will scan your drives to find /NARF and do the CAT. If you remove /NARF
completely and do a CAT, ProDOS will say there is a "PATH NOT FOUND" error.

     Naturally, you can set the default prefix to a specific folder. For
example,

PREFIX /NARF/EAMON/

or, in a BASIC program

100 PRINT CHR$(4)"PREFIX /NARF/EAMON/"

sets the volume (/NARF/) plus folder (EAMON/) as the new default prefix. A
program running in that folder can BLOAD picture, etc. files and RUN games in
that folder without worrying about the names of the volume and folder in which
your Eamon stuff is located.

     If you know that the EAMON folder is in the currently active directory,
you can use

PREFIX EAMON/

or, in a BASIC program

100 PRINT CHR$(4)"PREFIX EAMON/"

to set the folder as the default location without having to specify volume
name. If the current default is /NARF/, the command will result in the new
default being /NARF/EAMON/. If the current default is /NARF/GAMES/, the new
default will be /NARF/GAMES/EAMON/.

If there is no default path at the time the command is executed, ProDOS will
read the volume name, check for the EAMON/ folder, and add "EAMON/" to create
the complete default pathname prefix.

     Setting a default pathname prefix does not prevent using commands which
specify other locations. For instance

CAT /PICS/BOXES/

will look for the BOXES/ folder on the volume /PICS/ and do a CAT.

     To clear (eliminate) the default pathname prefix, use

PREFIX/  ("PREFIX" followed by a "/")

______________________

By:  Rubywand
    

 

Continue to:













TOP
previous page: 06.032 What is the default volume and folder (directory) when ProDOS boots?
  
page up: Apple II Csa2 FAQs
  
next page: 06.034 How can I discover the volume name of a just booted disk?