Re: IsReadableFileAtPath
Re: IsReadableFileAtPath
- Subject: Re: IsReadableFileAtPath
- From: Kevin Perry <email@hidden>
- Date: Mon, 1 Mar 2010 11:37:06 -0800
In general, this kind of check-then-do pattern opens the door for file system race conditions. The documentation for this method (and related methods) has a little more information about this in the "Note" section.
Could you just try to copy the symlink and then deal with any errors that result?
-Kevin
On Mar 1, 2010, at 11:20 AM, gMail.com wrote:
> Hi,
> I need to check whether a file or a symlink could be really copied.
> I have just seen that the Cocoa API isReadableFileAtPath traverses the
> symlink, so, in case the target file is not readable, my app doesn't copy
> the symlink, while the Finder can properly do. So my app does wrong.
>
> The question is:
> How can I understand whether a file or symlink can really be copied?
> I have seen that isReadableFileAtPath uses the C command "access" which
> indeed traverses the symlink. So I cannot use it. So, any idea?
> And I wouldn't use the Carbon APIs because I need to compile for 64 bit.
> Thank you.
>
> Leonardo
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden