Re: Absolute Paths
Re: Absolute Paths
- Subject: Re: Absolute Paths
- From: Josh Aas <email@hidden>
- Date: Sat, 25 May 2002 19:24:48 -0500
I don9t know how efficient this is, but I had to solve this problem the
other day. I couldn't find a better way to do it. I'd be interested if
anyone else could.
- (NSArray*)getDirPaths:(NSString*)directory {
int i;
NSMutableArray *dirContents = [FileManager
directoryContentsAtPath:directory];
for (i = 0; i < [dirContents count]; i++) {
[dirContents replaceObjectAtIndex:i withObject:[NSString
pathWithComponents:
[NSArray arrayWithObjects:directory, [dirContents
objectAtIndex:i], nil]]];
}
return dirContents;
}
Hope that helps!
-Josh Aas
>
I am stepping through a directory and picking certain files, but the paths
>
that are returned to me are relative. Is there anyway I can get the absolute
>
path of the file? I could attach the relative path to the guaranteed absolute
>
path of the directory, but I still want to know if there is a direct way to
>
get the absolute path of the file. Thank you.
>
_______________________________________________
>
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.