Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Can access resource fork from Cocoa?

Can access resource fork from Cocoa?
Thread Tools
Grizzled Veteran
Join Date: Dec 2000
Location: Málaga, Spain, Europe, Earth, Solar System
Status: Offline
Reply With Quote
May 21, 2001, 04:30 PM
 
Hi there!

I'm planning to do a complete rewrite of one application I developed in REALbasic to turn it Cocoa for Mac OS X. But I need to know if there is any access to the resource fork of a file with Cocoa, any class or API that help in the process of opening and dealing with resources.

Any help? Thanks in advance.
     
Dedicated MacNNer
Join Date: Apr 2001
Location: San Francisco, USA
Status: Offline
Reply With Quote
May 21, 2001, 10:33 PM
 
I'm pretty sure you have to use Carbon to deal with resource forks. Carbon is ugly, procedural code, but you can easily call it from within your Cocoa app. Just add the Carbon framework(s) to your project and import the .h files you need. The Carbon documentation on developer.apple.com should have all the resource fork API details.

As an aside, I found that in Terminal you can access the resource fork of a file by appending /rsrc to the filename. For example:

% cp file1/rsrc file2

This copies the resource fork of 'file1' into the data fork of 'file2'. You might be able to use this /rsrc convention for accessing resource forks using the Cocoa file APIs.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 22, 2001, 01:24 PM
 
There's a discussion about it here: http://www.cocoadev.com/index.pl?UsingResourceForks
     
Fresh-Faced Recruit
Join Date: May 2001
Location: Austin, TX, USA
Status: Offline
Reply With Quote
May 22, 2001, 07:04 PM
 
What will that get you (out of curiosity)? In other words, why do that?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 23, 2001, 03:12 PM
 
A non-bog-slow, non-buggy, proper, decent program, written using frameworks supported by a big company which can actually code, unlike REALsoftware. REALbasic is a joke, 3.2 is incredibly slow (even for basic things like typing into the editor). Admittedly, RB is good for fast development of small projects, but that's about it.

RB is also not terribly useful in the real world. Obj-C is a superset of C, and many, many programming and scripting language have similar syntax. I find REALbasic and Real Software increasingly hilarious, and I'd like to thank you, Lorin, for bringing me more than a few laughs.
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
May 23, 2001, 04:22 PM
 
Originally posted by Angus_D:
RB is also not terribly useful in the real world. Obj-C is a superset of C, and many, many programming and scripting language have similar syntax. I find REALbasic and Real Software increasingly hilarious, and I'd like to thank you, Lorin, for bringing me more than a few laughs.
Heh heh, you sound like the people in the database forums comparing FileMaker to Oracle.

Different products have different advantages.

BTW, how do you make a Windows program in Cocoa*? How do you make a MacOS 9 program in Cocoa? Oh, you can't - hmmm.

*Yes, I know about Yellow Box for Windows, but that is no longer available.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 24, 2001, 01:08 PM
 
I find REALbasic an increasingly funny joke. I only know of one person who has written a decently-sized, working program in REALbasic, and he's had to extend and event patch REALbasic at runtime quite a lot.

If you want Windows/OS X, you should be able to use Qt quite soon.

If you want Classic/OS X, use Carbon.

If you want Classic/OS X/Windows, there aren't any readily available frameworks that are free AFAIK, apart from wxWindows which I hear is quite buggy.

REALbasic's Windows support has always been iffy, and Carbon too (especially in 3.0, which touted Carbon as a major improvement whereas it's only really usable in 3.2). Carbon has gotten a lot better these days, but there are still many blatant bugs.

Cocoa is much more powerful than REALbasic, admittedly you don't get supposed cross-compilation for Classic/OSX/Windows, but there will be an increasing market for OS X apps, and I don't think that many people will be using REALbasic Carbon apps.

Still, I'm rambling and just have a terribly low opinion of REALbasic and REAL Software or Real Software or however you capitalize it these days.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2