Re: FSRefMakePath: error -35
Re: FSRefMakePath: error -35
- Subject: Re: FSRefMakePath: error -35
- From: Lawrence Sanbourne <email@hidden>
- Date: Sun, 23 Oct 2005 11:07:30 -0500
On 10/23/05, Dair Grant <email@hidden> wrote:
> Lawrence Sanbourne wrote:
>
> >> It *will* fail on some people's computers. Try to use something much
> >> larger (if possible). I usually use PATH_MAX*6, although that still
> >> isn't the best way to do it.
> ...
> >
> >Hmm, this sounds ugly. I think for simplicity I'll use PATH_MAX*6.
>
> Given that you're calling yourself recursively, is there some reason you
> don't just take an FSRef as your parameter?
>
> That would cut out the FSRef->path and path->FSRef overhead, and avoid
> the problem of failing if (when) your path exceeds PATH_MAX (*6 is just
> deferring the point at which it happens - if you stick to FSRefs, you'll
> be able to recurse to arbitrary depths).
I used an NSString as a parameter because I wanted it to have a Cocoa
interface, but you're right about the inefficiency. I'll create a
second private function that does all the work, including the
recursion, and make the public one have an NSString interface.
Is there some existing NS* class that I should graft this on as a
category? I'm trying to imagine where Apple would put it if they were
adding it.
Larry
--
Larry Sanbourne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden