• 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
Filename of File Relative to Directory It's In
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Filename of File Relative to Directory It's In


  • Subject: Filename of File Relative to Directory It's In
  • From: Evan DiBiase <email@hidden>
  • Date: Wed, 6 Mar 2002 23:46:26 -0500

Hello,

I'd like to get the filename of a file relative to the directory that it's in (for example, /Application/iTunes.app becomes iTunes or iTunes.app; ideally there would be some way to know if the extension on the given file was hidden or not).

I attempted to use something like:

- (NSString *)filename
{
NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initWithPath:[self path]];
return [fileWrapper filename];
}

This took an exceptionally long amount of time to work, however, so I'm turning to the list in the hopes that there's a better solution.

-evan
_______________________________________________
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.

  • Follow-Ups:
    • Re: Filename of File Relative to Directory It's In
      • From: Evan DiBiase <email@hidden>
  • Prev by Date: Re: NSToolbar Design
  • Next by Date: Re: Filename of File Relative to Directory It's In
  • Previous by thread: Re: Specific byte size data type?
  • Next by thread: Re: Filename of File Relative to Directory It's In
  • Index(es):
    • Date
    • Thread