[comp.sys.mac.programmer] Resource File for preferences?

nick@cs.edinburgh.ac.uk (Nick Rothwell) (10/09/90)

I need to implement a (System Folder) preferences file for an
application. I'm toying with the idea of using a resource file rather
than a data file; that way I can put in several types of preference
information and look them up by resource type, rather than invent and
parse my own file format.

Is there anything wrong with this approach? I seem to recall a Tech Note
threatening to set the Toolbox Police on anyone who tried to use the
Resource Manager as a database...

On a more general note: since all my data files are of fixed size, and I
don't need random access or sequential read/write, why should I use data
files at all? 

		Nick.

-- 
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcsun!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
 "Now remember - and this is most important - you must think in Russian."

francis@arthur.uchicago.edu (Francis Stracke) (10/10/90)

In article <546@skye.cs.ed.ac.uk> nick@lfcs.ed.ac.uk writes:
>I need to implement a (System Folder) preferences file for an
>application. I'm toying with the idea of using a resource file rather
[...]
>Is there anything wrong with this approach? I seem to recall a Tech Note
>threatening to set the Toolbox Police on anyone who tried to use the
>Resource Manager as a database...
>
>On a more general note: since all my data files are of fixed size, and I
>don't need random access or sequential read/write, why should I use data
>files at all? 
>

That TN specifically said the problem was that, for huge files,
(primarily, ones done by the user), the Resource Manager would be
much too slow--also, it would introduce an arbitrary limit (i.e.,
2^16 resources of each type).  A prefs file should be no problem--
quite small, no? And I would guess that, if your data files can't
grow at the user's whim, it should be OK.  (The only real problem
I can see here is if you use a type that winds up happening to
overlap with some other program's file
open at the same time, maybe by a DA,
& you read that other file.  This would probably happen only if
your file doesn't happen to contain the type.)

| Francis Stracke		| My opinions are my own.  I don't steal them.|
| Department of Mathematics	|=============================================|
| University of Chicago		| A mathematician is a professional	      |
| francis@zaphod.uchicago.edu	|   schizophrenic.--Me.		       	      |