From: gdesroch@slate.mines.colorado.edu (DESROCHERS GARY FREDERIC)
Newsgroups: comp.sys.apple2
Subject: Re: HELP!  In need of a GS/OS guru!
Date: 24 Jul 92 23:17:45 GMT
Organization: Colorado School of Mines

gopher@bnr.ca (Jeff Robertson) writes:
: HELP!
: 
: So.  What I need is some kind GS/OS guru to bring me up to
: date.  What does the Key Pointer of a type $5 file point to?
: Or, more generally, how the heck can I get my file back?
: It wasn't huge, but I'm more interested in not having a
: corrupt file on my drive.  (And the pursuit of knowledge...)
: Oh yes, I'm running System 6 (of course).

     I not a guru but I try <grunt>:

     The filetype of $05 is a pascal data file.  The key pointer to this
file depends on what type of file it is.  For a seedling file the key block
is the file itself.  Since yours seems to be bigger then that I would say
it is a sapling file.  It doesn't sound big enough for a tree file.  This
means that your key pointer points to an index block.  The index block is
set up so that each block (starting with what used to be your seedling
block) is listed sequentially.  It does not put it in low byte high byte
order though.  The first block's low part of the block number is stored in
the first half of the block and the high part of the block number is stored
in the upper part of the block.  For instance:

start of block 010A:

First Half
09 0B 0C 00 00 00 00 00 

-----------------------

Second Half
01 01 01 00

     This file has 4 blocks to it.  The index block 010A, the first block
0109, the second block 010B, and the third block 010C.  This is what it may
look like on an unfragmented disk.  A very fragmented may have block
numbers from all over the disk.  The Key pointer of the file would point to
block 010A.

     As to how to get it back?  I don't know what the condition of the disk
is.  Sounds like your index may have been overwritten.  If it is only the
index block then you can locate all the blocks manually (of course, you can
try to get a utility that does this for you.) and save them.  Then format a
knew disk and then create a new file header, index block, save the file
blocks to what you said they were in the index block and then update the
disk volume bitmap.  Then copy it to a safe place and try it out.  If it
works then reformat the trial disk.  Do not attemp this on the hard disk.
Also, a good suggestion would be to format your hard (startup? is it a hard
disk?) disk.  If you had to reinstall stuff it is probably very corrupt.
(just a hunch.)

    Your worry about a messed up disk is pretty good.  Don't think it is
the only file.  If you had to reinstall stuff then your drive is very
messed up.

     I hope this helps.

Gary
gdesroch@slate.mines.colorado.edu


: 
: Please post any suggestions to the net, or mail to my
: account - gopher@bnr.ca
: 
: Thanks for your time...
: 
: ---
: Jeff Robertson
: 4A Systems Design Engineering
: University of Waterloo / Bell Northern Research
: "But what does it all _mean_? / What?  The custard?"
-- 
 ---------------------------------------------------------------------
 Gary F. Desrochers        INTERNET: gdesroch@slate.mines.colorado.edu
                           GENIE:    G.Desrochers
 Any comments/complaints on Disk Witch tell me.  Apple II Forever!!
Newsgroups: comp.sys.apple2,from.socal.com