Re: Filename of File Relative to Directory It's In
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.