paths for contents of a directory
paths for contents of a directory
- Subject: paths for contents of a directory
- From: Roland Silver <email@hidden>
- Date: Mon, 14 May 2007 22:32:53 -0600
Given a string directoryPath which is a path to a directory, is there
some simple way to iterate over the members of the directory which
yields not just the file name of the member, but its complete path name?
With this code:
NSArray* directoryContents =
[[NSFileManager defaultManager]
directoryContentsAtPath:directoryPath];
NSString* path;
NSEnumerator *enumerator = [directoryContents objectEnumerator];
while (path = [enumerator nextObject]) {
...
}
the variable "path" (surprisingly) is bound to the file names of the
successive entries of the directory, rather than to their path names
-- which are what I need to extract the contents of the files in the
directory.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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