In article <46601a10$0$14137$742ec2ed@[EMAIL PROTECTED]
>,
Don Bruder <dakidd@[EMAIL PROTECTED]
> wrote:
> In article <uce-88022B.07205301062007@[EMAIL PROTECTED]
>,
> Gregory Weston <uce@[EMAIL PROTECTED]
> wrote:
>
> > In article <465fb6ab$0$14071$742ec2ed@[EMAIL PROTECTED]
>,
> > Don Bruder <dakidd@[EMAIL PROTECTED]
> wrote:
> >
> > > Oh, to bring things back on-topic, Bo's suggestion (the
FSFindFolder()
> > > function) is working perfectly - toss the resulting FSRef for the
user's
> > > homedir to FSRefMakePath() to get ThePath in a form I can tinker
with,
> > > strcat(&ThePath, "/Client.log") to tack the filename onto it, run
> > > ThePath back into FSPathMakeRef(), and I've got exactly what I need,
> > > working exactly as wanted. Minimal heartburn, maximal function -
Gotta
> > > love it :)
> >
> > If all you're doing is trying to build a reference to a file within a
> > known directory, you can do it in one shot with this instead of
> > converting to path, appending the leaf name, and converting back to
ref.
> >
> > OSErr FSMakeFSRefUnicode (
> > const FSRef * parentRef,
> > UniCharCount nameLength,
> > const UniChar * name,
> > TextEncoding textEncodingHint,
> > FSRef * newRef
> > );
> >
> >
> > Only 1 line to debug and only one error code to check.
>
> Doesn't that shove me (kicking and screaming every inch of the way...)
> into fiddling with unicode,
The kicking and screaming is only if you insist on doing so, and you
don't really need to fiddle, no.
> which in turn forces me (kicking harder, and
> screaming louder) to deal with the god-awful abortion of CFString?
Editorializing aside, you _can_ use CFString along this route, but
aren't required to do so. You could, for example, just do this:
UniChar theLeafName[] = {'C','l','i','e','n','t','.','l','o','g'};
FSMakeFSRefUnicode(theParent, 10, theLeafName, kTextEncodingUnknown,
&theLeafRef);
Granted it's not the most readable thing in the world (and you end up
with magic numbers in your code), but you only have to do it once and it
saves you from CFString.
> (Call me a throwback, or whatever, but I *HATE* the hassle of trying to
> deal with CFString stuff
What hassle? Seriously.
G


|