Re: Contents of a directory?
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.