• 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: Contents of a directory?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contents of a directory?


  • Subject: Re: Contents of a directory?
  • From: Chris Roberts <email@hidden>
  • Date: Sat, 20 Jul 2002 20:13:25 -0600
  • Resent-date: Sat, 20 Jul 2002 20:14:23 -0600
  • Resent-from: Chris Roberts <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: email@hidden

NSDirectoryEnumerator:

- (void)getAllPkgsOnly{
NSDirectoryEnumerator *enumer = [[NSFileManager defaultManager]
enumeratorAtPath:@"/Library/Receipts"];
while (pathname=[enumer nextObject]){
if([[pathname pathExtension] isEqualToString:@"pkg"]){
[enumer skipDescendents];
[allpackages addObject:pathname];
//we only want packages listed
}else{
//do nothing it is not a package
}

}

Chris Roberts
osxgnu.org


On Saturday, July 20, 2002, at 06:47 PM, Jaime Magiera wrote:

How does one go about getting the contents of a directory? I need an array of the file names and paths. Is there a function that will return the whole contents, or do I have to use a single file function in a loop?

thanks,

Jaime
_______________________________________________
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.
_______________________________________________
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: Contents of a directory?
      • From: Isaac Sherman <email@hidden>
  • Prev by Date: reading a plist
  • Next by Date: Re: Contents of a directory?
  • Previous by thread: Contents of a directory?
  • Next by thread: Re: Contents of a directory?
  • Index(es):
    • Date
    • Thread