[comp.sys.apple2] CDEV won't write to resource fork during boot! Arrgh!

jeffn@nuchat.UUCP (Jeff Noxon) (09/25/90)

I'm writing a CDEV that -needs- to be able to modify a user resource during
boot.  I can read/write the resource fine when the control panel is active,
however during the boot strange things happen:

   o  A routine is called that reads two user resources, and it does
	this properly.
   o  A routine is called that modifies one of the user resources if
	necessary.  I've tried _MarkResourceChange and _WriteResource.
	Both of these return with no error but do NOTHING.

I've traced through this with GSbugs by placing a brk in the beginning of
the CDEV boot routine.  The memory is modified properly, the calls claim
to work okay, but don't do anything.

I've tried fiddling around with other resource manager calls to force the
fork to be written, but it's not happening.

The exact same code works when later executed from the Control Panel.

Is resource manager documentation available in release form yet?  What
book can I find it in?  ISBN #?  I'm trying to do this with E16 and M16
files as my only documentation.  Ouch!

Any ideas appreciated.

Jeff

-- 
Jeff Noxon                      | Stop complaining and do something about
jeffn@nuchat.sccsi.com          | it.  Really!
713/721-6820 (CDT) Houston, TX  | 

mattd@Apple.COM (Matt Deatherage) (09/26/90)

In article <28572@nuchat.UUCP> jeffn@nuchat.UUCP (Jeff Noxon) writes:
>I'm writing a CDEV that -needs- to be able to modify a user resource during
>boot.  I can read/write the resource fine when the control panel is active,
>however during the boot strange things happen:
>
>   o  A routine is called that reads two user resources, and it does
>	this properly.
>   o  A routine is called that modifies one of the user resources if
>	necessary.  I've tried _MarkResourceChange and _WriteResource.
>	Both of these return with no error but do NOTHING.
>
>I've traced through this with GSbugs by placing a brk in the beginning of
>the CDEV boot routine.  The memory is modified properly, the calls claim
>to work okay, but don't do anything.
>
>I've tried fiddling around with other resource manager calls to force the
>fork to be written, but it's not happening.
>
>The exact same code works when later executed from the Control Panel.
>
CDEV.INIT, which is what's excecuting your CDEV's boot code, opens your
resource file read-only.  You actually don't want to be writing to your
own CDEV file anyway, because one person's changes then get applied to everyone
who boots over the same AppleShare server (unless you don't have write
permission to the CDEVs folder, in which case you're right back where you
started).  Better to create a configuration file and write your data, even just
as resources, to it.  Put it in the user folder if you're booting off
AppleShare.

>Is resource manager documentation available in release form yet?  What
>book can I find it in?  ISBN #?  I'm trying to do this with E16 and M16
>files as my only documentation.  Ouch!
>
>Jeff Noxon                      | Stop complaining and do something about
>jeffn@nuchat.sccsi.com          | it.  Really!
>713/721-6820 (CDT) Houston, TX  | 

Your signature combined with this question is almost appalling.  Resource
Manager documentation has been available at APDA for OVER A YEAR, and the
final final Addison-Wesley book (Tooblox Reference Vol. 3, ISBN #0-201-55019-9)
has been available in bookstores around the country for nearly three months.
Did you even try *looking* in obvious places like APDA or A2-Central for
the documentation?

-- 
============================================================================
Matt Deatherage, Apple Computer, Inc. | "The opinions represented here are
Developer Technical Support, Apple II |  not necessarily those of Apple
Group.  Personal mail only, please.   |  Computer, Inc.  Remember that."
============================================================================