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