🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.help
Article #15

Re: Can an OSType be interchanged with a Str255? How?

#15
From: Martin Adler
Date: Mon, 21 Aug 1995 11:54
22 lines
1075 bytes
In article <oylerb-2108950006040001@msp1-5.nas.mr.net>,
oylerb@tdkt.skypoint.net (Bill A. Oyler) wrote:

> Hello,
> 
> This should be a simple question.  I need to change the creator of a file
> by using the SetFInfo toolbox call.  The creator is stored in a Str255,
> however, not in an OSType like the call requires.
> 
> How can I convert a Str255 to an OSType?  I tried some different methods
> of typecasting, but can't get anything to work.  Help!  :)

Try:

OSType   myOSType;
Str255   myStr255;
...
myOSType = *((OSType *) (myStr255 + 1));
...

Gulpi
= Martin Adler
Technical Details
Message-ID: <adler-2108951354090001@138.244.207.201>
Path: arc1-ca.pugleaf.net!lrz-muenchen.de!NewsWatcher!user
References: <oylerb-2108950006040001@msp1-5.nas.mr.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!lrz-muenchen.de!NewsWatcher!user
From: adler@informatik.tu-muenchen.de (Martin Adler)
Newsgroups: comp.sys.mac.programmer.help,comp.lang.c
Subject: Re: Can an OSType be interchanged with a Str255?  How?
Date: Mon, 21 Aug 1995 13:54:09 +0200
Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
Distribution: world
Message-ID: <adler-2108951354090001@138.244.207.201>
References: <oylerb-2108950006040001@msp1-5.nas.mr.net>
NNTP-Posting-Host: 138.244.207.201