Rob Pitt wrote:
> Thanks Phil BUT my "stacks" are on the CD-ROM. The path I need
> is to text files on the hard drive. In the README I offer users
> the ability to customise critical portions of my "stacks" by
> placing text files in a first level folder/directory with the
> name "PPacTxt". The buttons, report header fields etc open and
> read from the text file on openCard. This is all easy to do on
> Windows because the simplified script is:
> put "/C:/PPacTxt/textFile"" into introFile
> if there is a file introFile then
> open file introFile
> read from file introFile until eof
> put it into bg fld "field"
>
> BUT how do I do this in MacOS when I dont know the name of the
> hard drive
> eg. the path could be "/Macintosh HD/PPacTxt/textFile" or
> "/Wallies HD/PPacTxt/textFile" or "/!*!*!*!/PPacTxt/textFile" etc.
The "problem" on a Mac is the user could be using any number of hard
disks, network drives and floppy disks. Apple's recommended solution is
to keep all configuration info in the "Preferences" sub-directory of the
current System Folder. All you need then is an external to give you a
path to the System Folder, and then append
"/Preferences/PPacTxt/textFile" to it. If you are clever, you can even
produce an editor for the configuration file so the user doesn't even
need to know where it is. This is probably a good idea on any platform.
And the best thing about Apple's solution is that if the user decides to
rename their hard disk, it won't break your application.
And if I can make a suggestion, how about calling the configuration file
something like "User Settings.txt" or another name that suggests what
its contents are?
--
Steven D'Aprano
==========================================
M.B. Sales Pty Ltd Ph: +61 3 9460-5244
A.C.N. 005-964-796 Fax: +61 3 9462-1161