home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!taligent!keith@taligent.com
- From: keith@taligent.com (Keith Rollin)
- Subject: Re: vrefNum from Path Name
- Message-ID: <Btwwt5.7Bv@taligent.com>
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Organization: Taligent
- References: <47022@shamash.cdc.com>
- Distribution: usa
- Date: Tue, 1 Sep 1992 18:31:53 GMT
- Lines: 33
-
- In article <47022@shamash.cdc.com>, paul@svl.cdc.com (Paul Kohlmiller) writes:
- >
- > This may be a FAQ but I didn't find it.
- > Most Mac apps have a dialog box to find a file such as the one you
- > get with SFGetFile etc.
- > When you do this you get the vrefNum but not the parID which is
- > another problem for later.
- > However, I have an application that wants to get the file from a
- > pathname and there is no place for a vrefNum. While this seems
- > unMaclike, it seems to work for MPW which can take a path name in
- > a Link command. Maybe simply opening a file can be done with just
- > a path but LaunchApplication needs a FSSpec which needs the
- > vrefNum and the parID. The parID I can set to 0 for now (do I care
- > about parID on non-A/UX apps) but the vrefNum I need. The best
- > solution I have so far is to do the dialog box once and keep the
- > vrefNum info. What I would like is a function that returns vrefNum
- > from a file pathname but I don't see it. Any ideas?
-
- Page 25-16 of Inside Mac VI shows that FSMakeFSSpec can take a full pathname.
- When you feed it a full pathname, the vRefNum and parID you pass it are ignored.
- The vRefNum and parID fields of the FSSpec record it returns will be filled out
- properly from the information in the full pathname.
-
- Remember, Inside Mac says that you should _NOT_ create FSSpecs by hand. You
- should always call FSMakeFSSpec. Don't go filling in the parID and vRefNum
- fields yourself. (There is one exception to this, which is that you can freely
- assign one FSSpec record to another.)
-
- --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
-