Copyright © Curt Rostenbach
The most common question about ProDOS concerns something that is very fundamental to using ProDOS, that being “What is a pathname?”
Pathnames are initially confusing, but once you understand them, you have the keys to ProDOS.
Under DOS 3.3 we have FILE names, they are a unique sequence of characters that identify programs or data that is stored on a disk The operating system keeps track of what files are on a disk by storing the filenames in the CATALOG. In the catalog, the operating system maintains for each filename, information such as type, size, protection, and location.
Under ProDOS, we still have filenames, although compared to DOS 3.3 they do seem restrictive in nature. Filenames under DOS 3.3 could be up to thirty characters long and aside from the restriction that a filename must begin with a letter, the rest of the filename, could be almost any combination of characters. When DOS first came out, to veteran computer users the 30 character filenames were monstrous! At the time, filenames on other computers and their operating systems were 6 to 16 characters, ProDOS allows 15 character filenames made of letters or numbers, no spaces or special characters other than a period. ProDOS, some will no doubt say, has taken a step backwards from easy to use home computers to the monolithic monster mainframes.
Not really, most people do not like typing 30 character filenames. We’ve all learned to “cursor over” those long names displayed by a catalog. The problem has usually been how to stop a long catalog to see and type/cursor-over the filename. When you do a ProDOS catalog command (there are two kinds) on a disk with a lot of files on it, you do not have to press a key every screen and you can type Control-C to stop the catalog.
Still, what is a pathname? Under ProDOS, disks now have names. The disk names are called VOLUME names. DOS 3.3 formatted disks have volume #s. Names now instead of numbers. DOS 3.3 volume numbers are rarely used. In DOS 3.1 they were a bloody nuisance. They were initially conceived to be a protection against yourself device. To prevent you from switching disks in a drive and writing to the wrong data disk, the operating system would always check the volume number of the current disk to the volume number of the previously used disk. If they were not the same, VOLUME MISMATCH ERROR would jump up at you. And early on, you had to specify a volume number when you initialized a disk. And that encouraged you to give each one a different number. It was a real pain to change disks and type 'CATALOG' and get an error message for you efforts. You had to type ‘CATALOG,V0’ to avoid it. DOS 3.2 corrected that problem by assuming ‘V0’ unless you specified a different volume number. DOS 3.3 assumes V254 when you init a disk, unless you specify otherwise.
So what’s the difference? Volume names instead of numbers for ProDOS, what’s the advantage? One advantage, is that names are usually easier to remember than numbers. Another is that they can be used to categorize the contents of a disk, “/GAMES” is easier than “V10”. Volume names can also be changed. With DOS, the volume number is written into the sector ID marker of all 560 sectors on a disk and cannot be changed without risking damage to the sector contents. These sector volume numbers still exist in ProDOS, but they are only there for compatibility with copy programs and not used by the operating system. Something like a human appendix is, a carry over from something that used to have a function in earlier model.
Since disks now have names under ProDOS, we need not concern ourselves about which drive unit the disk is in. We can now let the operating system worry about it. It is the operating system’s job to find a path to a file. We still must put it together for ProDOS. We must specify the disk name and the filename, together they make the PATHNAME.
Example; file name=SPACE.INVADERS, disk/volume name=”/GAMES”. The command and pathname is “RUN /GAMES/SPACE.INVADERS”, who cares where the disk is at, if it is on the system, the operating system will find it, if not, PATHNAME NOT FOUND. Note the use of “/” slash. The first one is used to signify that this is a complete pathname (I’ll explain partial pathnames below) the second slash is to separate the volume name from the file name.
You’re probably wondering why you should type in “RUN /GAMES/SPACE.INVADERS” when under DOS 3.3 you would just have to type “RUN SPACE INVADERS”. Well, you don’t have to (all the time). In DOS 3.3, you told or implied to the operating system where the file was going to be. If you had booted a disk, it implied drive 1, probably in slot 6. Or maybe you typed “CATALOG,D2” before running a program. Or maybe you typed “RUN SPACE INVADERS,D2” Any of these methods told DOS 3.3 what drive to go to for the file name. Since under ProDOS, it is the operating system’s responsibility to find the drive, provisions have been made to specify a PREFIX that the operating system will use if given a partial pathname. A partial pathname does not begin with a slash (/). So if we set PREFIX /GAMES, either through booting on that disk, or cataloging the drive, or using the PREFIX command, the operating system at some time verifies that the disk is in a drive somewhere on the system. After that, “RUN SPACE.INVADERS” under ProDOS would be mated with the prefix within the operating system so it would act as though you had typed “RUN /GAMES/SPACE.INVADERS”.
For use on floppy disk drives, the above is sufficient. But ProDOS can support more, and do more, and so SUBDIRECTORIES will be the subject for next month’s article.
Last modified 06/30/1998