home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!pageworks.com!world!eff!sol.ctr.columbia.edu!usc!wupost!csus.edu!netcom.com!leonardr
- From: leonardr@netcom.com (Leonard Rosenthol)
- Subject: Re: How to store file references/names ?
- Message-ID: <1992Nov15.172919.10970@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <1e5fvgINN835@uni-paderborn.de>
- Date: Sun, 15 Nov 1992 17:29:19 GMT
- Lines: 22
-
- In article <1e5fvgINN835@uni-paderborn.de> jerry@uni-paderborn.de writes:
- >What is the best (easiest?) way to store file informations in a preferences
- >file? My application reads an initialization file on startup and I want
- >to give the user the possibility to choose what file should be read.
- >I've heard that I should NOT try to store entire file names. Can I simply
- >bring up a file dialog and the store the file reference number? Or does
- >this number change as files and directories change on the hard disk?
- >
- If you are a System 7 only product, then the best way would be to
- create an alias to the file (via NewAlias) and then store the aliasHandle
- in your prefs file. If not, or if you will be working on both 6 & 7, then
- you need to create a new data structure which will store a volume NAME (
- volume reference numbers (vRefNums) are not valid across boots), a directory
- ID (dirID) and a file name. With that information you can get back to those
- files.
-
- --
- -----------------------------------------------------------------------------
- Leonard Rosenthol Internet: leonardr@netcom.com
- Director of Advanced Technology AppleLink: MACgician
- Aladdin Systems, Inc. GEnie: MACgician
-
-