• 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
directory size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

directory size


  • Subject: directory size
  • From: Chris Long <email@hidden>
  • Date: Fri, 7 Mar 2003 16:19:37 -0700

Does anyone know what would be wrong with this?

I am trying to get the size of a directory but I think the directoryDictionary is storing something other than the directory size. My values come out very small, like

NSNumber *directorySize;
NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:@"/Applications"];
NSDictionary *directoryDictionary = [direnum directoryAttributes];

if (directorySize = [directoryDictionary objectForKey:NSFileSize])
NSLog(@"Directory size: %@", directorySize);

I chose /Applications for testing purposes and using either /Applications or /Applications/ results in the same small value, in my case was 1666 when the actual size is about 733466624. Both in bytes.

Thanks in advance,
Chris Long
_______________________________________________
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: directory size
      • From: Frank Fenn <email@hidden>
  • Prev by Date: Re: [code] Source code for a Time Control
  • Next by Date: Threaded data freaking out
  • Previous by thread: RE: User Access
  • Next by thread: Re: directory size
  • Index(es):
    • Date
    • Thread