• 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
NSFileSize only returns nil or "6148"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFileSize only returns nil or "6148"


  • Subject: NSFileSize only returns nil or "6148"
  • From: Jaime Magiera <email@hidden>
  • Date: Tue, 23 Jul 2002 23:11:31 -0400

I'm having a slight problem with my iteration of a directory. The first iteration always returns a file size of "6148", no matter what file. Every iteration after that returns "nil". The file name is right every time so it seems to be iterating properly.

Here's the code. Can anyone spot a problem? Thanks.

-------------------------------------------

NSMutableDictionary *dict = [thePrefManager loadPreferences];

NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager]
enumeratorAtPath:[dict objectForKey:@"uploadsFolderPath"]];

while (pname = [direnum nextObject]) {

NSDictionary *fileAttributes = [theManager fileAttributesAtPath:pname traverseLink:false];

CFShow(pname);

if (fsize = [fileAttributes objectForKey:NSFileSize])
CFShow(fsize);
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSFileSize only returns nil or "6148"
      • From: Ondra Cada <email@hidden>
  • Prev by Date: ask about cocoa UI
  • Next by Date: Re: ask about cocoa UI
  • Previous by thread: Re: ask about cocoa UI
  • Next by thread: Re: NSFileSize only returns nil or "6148"
  • Index(es):
    • Date
    • Thread