In article <13605c02atob716@[EMAIL PROTECTED]
>,
SM Ryan <wyrmwif@[EMAIL PROTECTED]
> wrote:
> 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.
Did you catch the part in the post to which you responded a minute
earlier where I used the phrase "the right tool for the job?"
Did you notice that the OP is trying to create a reference to a single
file that already exists? (And, in fact, the error result this function
would give him if the file _doesn't_ exists, obviates some additional
code.)
You can answer all the unasked questions you like your own code, but
sarcastic reactions to people answering the actual questions don't help
anyone, including you.
G


|