• 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
Problem with fileAttributesAtPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with fileAttributesAtPath


  • Subject: Problem with fileAttributesAtPath
  • From: "Nicolas Goles" <email@hidden>
  • Date: Mon, 18 Aug 2008 15:24:02 -0400

Hi guys, I am trying to get fileAttributesAtPath using this code: (files
contains the path to the directory that was enumerated )

        while(object = [dirEnumerator nextObject])
        {

            //First We craft the whole path for a single object

            NSString *fullPath = [files stringByAppendingString:object];

            NSLog(@"%@",fullPath); //Log the full path just to be sure it's
correct

            if(!fullPath)
            {
                NSLog(@"Error when appending strings");
            }

            //Try to obtain fileAttributes
            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.

Could anyone point me at what I'm doing wrong ???

Thanks!! :)

--
-Nicolas Goles
_______________________________________________

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

  • Follow-Ups:
    • Re: Problem with fileAttributesAtPath
      • From: Randall Meadows <email@hidden>
    • Re: Problem with fileAttributesAtPath
      • From: Ken Thomases <email@hidden>
    • Re: Problem with fileAttributesAtPath
      • From: Charles Steinman <email@hidden>
    • Re: Problem with fileAttributesAtPath
      • From: Jason Coco <email@hidden>
  • Prev by Date: Re: ScriptingBrige InDesign
  • Next by Date: Re: Problem with fileAttributesAtPath
  • Previous by thread: Re: Removing Observers
  • Next by thread: Re: Problem with fileAttributesAtPath
  • Index(es):
    • Date
    • Thread