• 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: Path handling routines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path handling routines


  • Subject: Re: Path handling routines
  • From: Jamie Hardt <email@hidden>
  • Date: Wed, 29 Oct 2008 09:24:15 -0700


On Oct 29, 2008, at 6:01 AM, Daniel Luis dos Santos wrote:

Hello,

Are there in the Foundation framework (or anywhere else on the Cocoa platform) path handling routines (directory extraction, path decomposition) ?


NSString has several methods for extracting the basename, directory name, extension etc.

	• + pathWithComponents:
	• – pathComponents
	• – completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:
	• – fileSystemRepresentation
	• – getFileSystemRepresentation:maxLength:
	• – isAbsolutePath
	• – lastPathComponent
	• – pathExtension
	• – stringByAbbreviatingWithTildeInPath
	• – stringByAppendingPathComponent:
	• – stringByAppendingPathExtension:
	• – stringByDeletingLastPathComponent
	• – stringByDeletingPathExtension
	• – stringByExpandingTildeInPath
	• – stringByResolvingSymlinksInPath
	• – stringByStandardizingPath
	• – stringsByAppendingPaths:

The safest way of turning argv[i] into an NSString is with NSFileManager, thus:

NSString *path = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:argv[i] length:strlen(argv[i])];


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: Path handling routines
      • From: Douglas Davidson <email@hidden>
References: 
 >Path handling routines (From: Daniel Luis dos Santos <email@hidden>)

  • Prev by Date: How do I call a function when my preference pane bundle closes?
  • Next by Date: Re: Path handling routines
  • Previous by thread: Re: Path handling routines
  • Next by thread: Re: Path handling routines
  • Index(es):
    • Date
    • Thread