Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / September 2004



Tip: Looking for answers? Try searching our database.

How to flatten resource files in CW9

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric VERGNAUD - 24 Sep 2004 23:15 GMT
It's all in the subject
Miro Jurisic - 25 Sep 2004 05:12 GMT
Why do you need to do this with CW? If you have a resource file, you can copy
its resource fork to a data fork using cp in Terminal. (cp
resourcefile/..namedfork/rsrc datafile)

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

Eric VERGNAUD - 25 Sep 2004 10:40 GMT
dans l'article macdev-4D9144.00121225092004@senator-bedfellow.mit.edu, Miro
Jurisic à macdev@meeroh.org a écrit le 25/09/04 6:12 :

> Why do you need to do this with CW? If you have a resource file, you can copy
> its resource fork to a data fork using cp in Terminal. (cp
> resourcefile/..namedfork/rsrc datafile)
>
> meeroh

I have multiple resource files in my project. In CW 8.3, they are
automatically merged and flattened with the exec name in the app package. In
CW 9 they are merged, but not flattened. This is a problem for FTP and
Windows servers on my network.

Eric
Miro Jurisic - 25 Sep 2004 18:10 GMT
> I have multiple resource files in my project. In CW 8.3, they are
> automatically merged and flattened with the exec name in the app package. In
> CW 9 they are merged, but not flattened. This is a problem for FTP and
> Windows servers on my network.

Do you mean .r files or .rsrc files?

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

Eric VERGNAUD - 26 Sep 2004 12:44 GMT
dans l'article macdev-369923.13105425092004@senator-bedfellow.mit.edu, Miro
Jurisic à macdev@meeroh.org a écrit le 25/09/04 19:10 :

>> I have multiple resource files in my project. In CW 8.3, they are
>> automatically merged and flattened with the exec name in the app package. In
[quoted text clipped - 4 lines]
>
> meeroh

.rsrc.

Eric
Miro Jurisic - 26 Sep 2004 17:19 GMT
> dans l'article macdev-369923.13105425092004@senator-bedfellow.mit.edu, Miro
> Jurisic à macdev@meeroh.org a écrit le 25/09/04 19:10 :
[quoted text clipped - 8 lines]
>
> .rsrc.

You should do what David suggested and remove the .rsrc files from the project,
replacing then with a .r file that includes them. What's going on here is that
CW, upon seeing a .rsrc file, simply copies it into the package, whereas for a
.r file it builds a new resource file (data fork-based, in your case) in the
package.

hth

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

Eric VERGNAUD - 26 Sep 2004 17:40 GMT
dans l'article macdev-AFB44B.12192526092004@senator-bedfellow.mit.edu, Miro
Jurisic à macdev@meeroh.org a écrit le 26/09/04 18:19 :

>> dans l'article macdev-369923.13105425092004@senator-bedfellow.mit.edu, Miro
>> Jurisic à macdev@meeroh.org a écrit le 25/09/04 19:10 :
[quoted text clipped - 19 lines]
>
> meeroh

How does CW decide to produce data fork-based files ? I couldn't find this
setting.

Eric
Miro Jurisic - 26 Sep 2004 23:50 GMT
> How does CW decide to produce data fork-based files ? I couldn't find this
> setting.

When it's building an application package, it does so automatically when
compiling .r files (but, as you observed, not when merging .rsrc files). If you
are building an unpackaged application, I believe you can choose, but I haven't
done that in ages so I could be wrong.

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

David Phillip Oster - 25 Sep 2004 20:58 GMT
> I have multiple resource files in my project. In CW 8.3, they are
> automatically merged and flattened with the exec name in the app package. In
> CW 9 they are merged, but not flattened. This is a problem for FTP and
> Windows servers on my network.

Assuming these are .rsrc files, then you can just use a simple single .r
file that includes them:

include "file1.rsrc";
include "file2.rsrc";

Note, in Rez, the language of .r files:

* '#include' does a textual include.  (no semicolon on this one.)
* 'include' copies the resources in the referenced file, and
* 'read' reads the data fork of a file as the contents of a resource.

If you've told CW 9 that it should output a data-fork resource file as
the result of .r compilation, then this should do the right thing for
you.

David Phillip Oster
Eric VERGNAUD - 26 Sep 2004 12:45 GMT
dans l'article oster-450408.12584425092004@newssvr14-ext.news.prodigy.com,
David Phillip Oster à oster@ieee.org a écrit le 25/09/04 21:58 :

> If you've told CW 9 that it should output a data-fork resource file as
> the result of .r compilation, then this should do the right thing for
> you.

And how do you do this ?

Eric
David Phillip Oster - 26 Sep 2004 22:00 GMT
> dans l'article oster-450408.12584425092004@newssvr14-ext.news.prodigy.com,
> David Phillip Oster à oster@ieee.org a écrit le 25/09/04 21:58 :
[quoted text clipped - 4 lines]
>
> And how do you do this ?

I do not believe it is an option: In a Codewarrior 9 packaged app, you
_always_ get a data-fork .rsrc file in the Resources folder of the
package of the application, with the same name as the target.

Just look at any of the Stationery (the result of the New Project
command on the File menu.)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.