• 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
[SOLVED] How do I open a file with a name like: "Ogg/OpenAL"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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


  • Follow-Ups:
    • Re: [SOLVED] How do I open a file with a name like: "Ogg/OpenAL"?
      • From: Nir Soffer <email@hidden>
References: 
 >Re: How do I open a file with a name like: "Ogg/OpenAL"? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Is there a way to change a buttons text color for the title?
  • Next by Date: Re: [SOLVED] How do I open a file with a name like: "Ogg/OpenAL"?
  • Previous by thread: Re: How do I open a file with a name like: "Ogg/OpenAL"?
  • Next by thread: Re: [SOLVED] How do I open a file with a name like: "Ogg/OpenAL"?
  • Index(es):
    • Date
    • Thread