[SOLVED] How do I open a file with a name like: "Ogg/OpenAL"?
[SOLVED] How do I open a file with a name like: "Ogg/OpenAL"?
- Subject: [SOLVED] How do I open a file with a name like: "Ogg/OpenAL"?
- From: "Alan Smith" <email@hidden>
- Date: Tue, 22 Aug 2006 08:11:04 -0400
Ah, got it. Thanks all.
But I made a big mistake, I had termed it a file when it was a folder.
I can't believe I did that.
It was a folder I had created via the Finder a long time ago when I
was writing a C++ wrapper on OggVorbis and OpenAL. That folder has all
of my OpenAL/OggVorbis files in it.
For the record:
- (NSString *)fullPath
{
int replacements = 0;
NSMutableString *string = [NSMutableString stringWithCapacity:
[relativePath length]];
[string setString: relativePath];
replacements = [string replaceOccurrencesOfString: @"/"
withString: @":" options: NSLiteralSearch range: NSMakeRange(0,
[relativePath length])];
if (replacements < 1)
[string replaceOccurrencesOfString: @":" withString: @"/"
options: NSLiteralSearch range: NSMakeRange(0, [relativePath
length])];
return [parent stringByAppendingPathComponent: string];
}
parent is the path leading up to the file without the file name. For
example: /Projects = parent, Ogg/OpenAL = relativePath.
Enjoy, Alan
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"Don't waste your life doing things others have already done."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden