home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!apple!NewsWatcher!user
- From: REEKES@applelink.apple.com (Jim Reekes)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: vrefNum from Path Name
- Message-ID: <REEKES-110992141418@90.10.20.67>
- Date: 11 Sep 92 21:16:25 GMT
- References: <47022@shamash.cdc.com> <Btwwt5.7Bv@taligent.com> <14960@borg.cs.unc.edu> <47148@shamash.cdc.com> <25rU03zf79dw00@amdahl.uts.amdahl.com>
- Sender: usenet@Apple.COM
- Followup-To: comp.sys.mac.programmer
- Distribution: usa
- Organization: Apple Computer, Inc.
- Lines: 50
-
- In article <25rU03zf79dw00@amdahl.uts.amdahl.com>, jsp@uts.amdahl.com
- (James Preston) wrote:
- >
- > paul@svl.cdc.com (Paul Kohlmiller) writes:
- >
- > }lari@strauss.cs.unc.edu (Humayun Lari) writes:
- >
- > }>In article <Btwwt5.7Bv@taligent.com> keith@taligent.com (Keith Rollin) writes:
- > } [says to always use FSMakeFSSpec and not create a FSSpec on your own.]
- > }>What about when the file/directory you're referring to does not exist?
- > }>If I remember correctly, FSMakeFSSpec checks to make sure that it does, so
- > }>it would return an error code when you're trying to create an FSSpec prior to
- > }>performing a Save As... Or am I wrong about this? Keith?
- >
- > }My reading of IM6 seems to say that you will get an error but the
- > }FSSpec is still good. Haven't tried it.
- > }Other Opinions welcome.
- >
- > I can vouch for this. FSMakeFSSpec returns the file not found error, but
- > goes ahead and makes a valid FSSpec for the missing file (i.e. the vRefNum
- > and dirID fields reference the correct folder, and the name field contains
- > the name of the non-existant file). A very handy feature. But do remember
- > that FSSpecs are only found on System 7.
-
- Folks, the answer can be found in the documentation.
-
- Inside Mac, 2nd Ed. "Files" page 2-167
-
- begin quote
-
- "If the specified volume is mounted and the specified parent directory
- exists, but the target file or directory doesn't exist in that location,
- FSMaskFSSpec fills in the record and then returns fnfErr instead of noErr.
- The record is valid but it describes a target that doesn't exist. You can
- use the record for other operations, such as creating a file with the
- FSpCreate function.
-
- In addition to the result codes that follow, FSMakeSFSpec can return a
- number of other File Manager error codes. If your application receives
- any result code other than noErr or fnfErr, all fields of the resulting
- FSSpec record are set to 0."
-
- end quote
-
- -----------------------------------------------------------------------
- Jim Reekes, Polterzeitgeist | Macintosh Toolbox Engineering
- | Sound Manager Expert
- Apple Computer, Inc. | RAll opinions expressed are mine, and do
- 20525 Mariani Ave. MS: 81-KS | not necessarily represent those of my
- Cupertino, CA 95014 | employer, Apple Computer Inc.S
-