Bundles with Carbon File Manager...

Posts: 277
Joined: 2004.10
Post: #1
I'm developing a File Manager for my current game.

It's very easy to use and will go into my code vault for future use...

but, there's one small problem,

When I use this function (got from apple.com technote):
OSErr _GetCurrentProcessFSSpec( FSSpec *outFSSpec )
  ProcessSerialNumber  currentProcess = { 0, kCurrentProcess };
  ProcessInfoRec       processInfo;
  processInfo.processInfoLength = sizeof(ProcessInfoRec);
  processInfo.processName       = NULL;  /* don't need the process name */
  processInfo.processAppSpec    = outFSSpec;
  return GetProcessInformation( &currentProcess, &processInfo );

It returns the executible (.app/Contents/MacOS) when I need it to return the .app......

I built a function for this job but it didn't work (it used catalog info to get the directory above the file/folder that your looking at, and looped however many times you wanted to move down the "directory tree")

I was wondering, with FSSpec, how to do this?
I've looked a CF but I can't find a conversion tool for converting it to FSSpec...


The code works fine as a CFM just not correctly as Mach-o but because I'm working with xCode and CW there has to be a bundle Sad

Global warming is caused by hobos and mooses
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
You do like to do this the hard way, don't you.

CFBundle has a function to get the bundle URL. That's the path you want.
CFURL has a function to convert to an FSRef.
Don't go near FSSpecs if you can possibly avoid them, they're not guaranteed to be able to represent every file on every volume. The only unavoidable place I've found is in QuickTime's GetGraphicsImporterForFile.
Quote this message in a reply
Posts: 277
Joined: 2004.10
Post: #3
I know how to convert FSRef into FSSpec.
I can update the code to use FSRef in the future, and all apps that use it.
and, I don't mind doing it the hard way.


Could you possibly give me the function names?
(the CFURL one mostly)

Global warming is caused by hobos and mooses
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to write a custom memory manager Malarkey 3 5,172 Oct 27, 2005 09:52 AM
Last Post: aqua_scummm
  Do you use HID Manager in your games? Andrew 10 7,824 Aug 14, 2005 01:00 PM
Last Post: wadesworld
  InputSprocket to HID Manager SethWillits 23 16,089 Oct 12, 2004 03:55 PM
Last Post: anonuser
  Carbon File Code Muffinking 5 7,377 Jun 3, 2002 12:23 AM
Last Post: henryj