Library Manager
Volume Number: 3
Issue Number: 8
Column Tag: Pascal Procedures
Library Manager Cures HFS Brain Damage
By Dave Rausch, Fullerton, CA
Dave Raush is an expert on Mac music generation
“File Not Found!”
How many times have you run a compiler or linker program only to have it come
up and say “file not found” after which the program returns you to the Finder or
worse, crashes the system. Then you have to find the mystery file the program wants,
then figure out which folder the program expects to find it, and try to coerce the
program into locating it. Programs that make you do this are HFS brain damaged. They
can’t find their way out of a paper bag. Microsoft is notorious for products which
either can’t find files (MS Basic) or require files to be in certain folders (MS Word),
or die when a file cannot be found (MS Fortran). While Apple provided an elegant way
for applications to allow the user to find a document, via the standard file dialog, no
thought was given to those types of programs which must locate a library or reference
file that is either not known to the user, or not directly related to a user created
document, but which is vital for the program to function. Think Technologies with
their Lightspeed C and Pascal was one of the first companies to market a truly HFS
smart compiler. If LS Pascal can’t find a file it needs, it asks the user to find it! What
could be simpler or more straight forward? Who needs path managers? Who needs
Finder DA’s? Who needs path name scripts? In this article I show how you can use this
technique to make your applications HFS smart, by putting up a standard file dialog if a
library file cannot be found. Once the user finds the file, it’s location is remembered
in a resource so the dialog does not have to be repeated unless the file is moved or
renamed. Why should a program (like 4th Dimension) prevent you from moving or
renaming your files? Even though HFS has been with us for over a year and a half,
many developers are still working around it, not with it. It’s time to make our
programs HFS friendly and this article will show you how to do it.
Library Manager Tracks Your Files
As Macintosh programs become smarter and heftier, the need increases to
maintain libraries of information that are external to the application itself. Because I
am currently developing an application that requires three separate kinds of open file
lists, I spent some time putting together what I call a “Library Manager” to help keep
things straight. The classic example of a file you would use the library manager to
track and open is the “dictionary”, a library type that may include a whole list of
generic, technical, and user-defined files that should be opened automatically without
unnecessary user intervention and without the user having to place them in either (a)