Article View: net.micro.mac
Article #860Writing random bytes to resource fork (1st Base)
From: David Levine
Date: Tue, 12 Mar 1985 18:49
Date: Tue, 12 Mar 1985 18:49
42 lines
3089 bytes
3089 bytes
I've been looking for a database. This weekend I found that 1st Base version
2.0 does everything I need except for one thing: it won't read an ASCII
file into a database. (If someone knows a way to make 1st Base read anything
other than a file prepared by 1st Base, let me know!)
So, thought I, why don't I take a look at the database file and see if I can
patch together something 1st Base will accept as one of its own? I thought it
should be pretty easy to write a program that would read my text file (from
MacTerminal) and produce a 1st Base formatted file.
I examined a 1st Base data file with Fedit to find out its structure. It
turns out that the data fork of a 1st Base data file is just a series of
fields, each padded with spaces to its full length. No delimiters of any sort
are used, it just counts bytes. The resource fork contains the description of
the fields.
The problem is that the resource fork is in some internal 1st Base format.
It's quite straightforward (something like <byte indicating length of field>
<the letter A> <sixteen bytes indicating the field name> repeated for each
text field), but it isn't a resource, it's just data stored in the resource
fork. The difference means that it's not in a format the Resource Manager can
deal with, so the Resource Editor and RMover just bomb out if you attempt to
open the file.
My question: How do you write non-resource-formatted data to the resource fork
of a file? At the moment, the only language I have is xlisp, but I can
probably find someone with a C compiler to write the simpleminded program it
would take to do it... if it's possible at all. Inside Mac is no help
whatsoever. (It must be possible, because 1st Base does it!)
Any other suggestions on how to make 1st Base eat an ASCII file would be
appreciated. I'm considering writing a Unix program to write the file to
file.rsrc and file.data and downloading, but that would introduce a THIRD
computer (the original data is on a CP/M machine).
If it really can't be done, I may have to consider a different database.
Microsoft File will do it, but I don't like its user interface. Mac Lion and
Helix are too expensive, and too complicated for the computer illiterates who
will have to use the system. Any other suggestions?
David D. Levine (...decvax!tektronix!orca!davidl) [UUCP]
(orca!davidl.tektronix@csnet-relay.csnet) [ARPA]
Technical Details
Message-ID:
<1394@orca.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!tektronix!orca!davidlShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site orca.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!tektronix!orca!davidl From: davidl@orca.UUCP (David Levine) Newsgroups: net.micro.mac Subject: Writing random bytes to resource fork (1st Base) Message-ID: <1394@orca.UUCP> Date: Tue, 12-Mar-85 13:49:48 EST Article-I.D.: orca.1394 Posted: Tue Mar 12 13:49:48 1985 Date-Received: Wed, 20-Mar-85 04:02:57 EST Reply-To: davidl@orca.UUCP (David Levine) Organization: Tektronix, Wilsonville OR Lines: 42 Fcc: macbox