• 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: Absolute Paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Absolute Paths
  • Next by Date: Mac OS X, Java, and Cocoa Debugging
  • Previous by thread: Re: Absolute Paths
  • Next by thread: Absolute paths
  • Index(es):
    • Date
    • Thread