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

Re: Filename of File Relative to Directory It's In


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

Cripes. One of those cases where I am up too late working on a project and forgot to do something simple like, oh, check the Foundation classes. My apologies.

It seems like working with NSFileManager is the best way to do this. If I'm not correct, I'd be interested in hearing better solutions; please discard this message otherwise.

-Evan

On Wednesday, March 6, 2002, at 11:46 PM, Evan DiBiase wrote:

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

References: 
 >Filename of File Relative to Directory It's In (From: Evan DiBiase <email@hidden>)

  • Prev by Date: Filename of File Relative to Directory It's In
  • Next by Date: Re: NSThread - plz help!!!
  • Previous by thread: Filename of File Relative to Directory It's In
  • Next by thread: Re: Filename of File Relative to Directory It's In
  • Index(es):
    • Date
    • Thread