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.
I can see how that's easier
I instead do complicated things like
asprintf(&childpath,"%s/%s",parentpath,childcomponent)
which unfortunately lets me refer to nonexistent directories
which I can mkdir at my leisure, or do any kind string editting
on because its only checked if it's a valid path when I try to
use it as a path. And we all know nobody would do something like
globbing for file names.
There's also the unfortunate issue that the kernel really doesn't
care about encoding, just bytes and the two special bytes '/' and
0.
There's the further problem that most of my code will ****t to,
say, Linux, so that I can follow customers to the Unix of their
choice.
--
SM Ryan http://www.rawbw.com/~wyrmwif/
I hope it feels so good to be right. There's nothing more
exhilarating pointing out the shortcomings of others, is there?


|