Re: Problem with fileAttributesAtPath
Re: Problem with fileAttributesAtPath
- Subject: Re: Problem with fileAttributesAtPath
- From: Charles Steinman <email@hidden>
- Date: Mon, 18 Aug 2008 12:41:53 -0700 (PDT)
--- On Mon, 8/18/08, Nicolas Goles <email@hidden> wrote:
> NSDictionary *fileAttributes = [manager
> fileAttributesAtPath:fullPath traverseLink:NO];
>
> if( fileAttributes != nil)
> {
>
> NSString *filetype = [fileAttributes
> objectForKey:NSFileType];
> NSLog(@"%@",filetype);
> }
>
> if(!fileAttributes)
> {
> NSLog(@"it's nill");
> }
> }
>
> The thing is that my fileAttributes it's always = nil
> so I always get "it's
> nill" on the console.
1. Are you sure that manager == [NSFileManager defaultManager]? I would just write the call to NSFileManager explicitly.
2. Are you sure that [[NSFileManager defaultManager] fileExistsAtPath:fullPath] == YES? Like perhaps there's somehow a shell expansion character like a tilde sneaking in there that NSFileManager doesn't deal with?
Cheers,
Chuck
_______________________________________________
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