[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with ProDOS file structure!
In article <phandel.2rei@sempco.uucp>,
Peter Handel <phandel@sempco.uucp> wrote:
> I keep on doing the stupidest thing: in ProTERM v3.1's editor, I load
> a big, important file, delete everything but the one line I want to
> send to the modem, and then forget to press escape; so when I hit
> <openapple> 's', I save the line onto the BIG file...ack. This has
> happened to me about 3 or 4 times. Here's my question: How do I edit
> the file's information to tell ProDOS that the file is 10 times as
> long as it thinks it is?
You can't do this directly. You'd have to do the following steps:
1. Locate all of the blocks on the disk that were used by the original
file, and work out which order they were in.
2. Create an index block which points to all of the data blocks. If
the file was 128k or larger, you need to create a multi-level index.
3. Modify the directory entry so that the number of blocks, EOF,
storage type, and key block pointer are correct for the recovered
file.
4. Fix the bitmap.
If you're lucky, the index block for the file might still be there,
saving you the first two steps. However, the first data block is
likely to have been overwritten when you saved the miniature version
(it depends on whether the ProTerm editor deletes the original file
before saving the new one, or saves the new one and then deletes the
original, and whether there were other free blocks on the disk).
This is not a straightforward task, and there are programs which will
recover deleted files for you (e.g. "FixCat", part of Bag Of Tricks,
and "Mr Fixit", part of ProSel).
Try to avoid making the mistake in future - it is much easier. LOCK
the file before you go into the editor, or save a copy somewhere else.
--
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand