• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with fileAttributesAtPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Problem with fileAttributesAtPath (From: "Nicolas Goles" <email@hidden>)

  • Prev by Date: Re: Problem with fileAttributesAtPath
  • Next by Date: Re: NSString Question
  • Previous by thread: Re: Problem with fileAttributesAtPath
  • Next by thread: Re: Problem with fileAttributesAtPath
  • Index(es):
    • Date
    • Thread