Re: Reading Files bit by bit... help please.
Re: Reading Files bit by bit... help please.
- Subject: Re: Reading Files bit by bit... help please.
- From: email@hidden
- Date: Mon, 29 Jan 2001 17:02:29 EST
Hi Ted!
Finally, someone as crazy as me, trying to replicate Oracle in Applescript ;
)
Here's some thoughts...
1) 68030 Macs - for Applescript, these are sloooooooowwwwwwwww. I'm talking
about a hundredfold or more speed difference between a 68030 and a G3 350
(ie. low end iMac). If you are doing disk accesses, the difference will
probably be even more apparent. If you have the option, bail out now and use
PPC (and lobby Apple to make a headless iMac for this sort of purpose).
2) reading part of a file - the read osax in standard additions has a number
of parameters to allow this, including using delimiters, delimiter list, read
until, read before, and reading from and to a specific integer offset.
Unfortunately, the write osax is less robust, and in 9.1, some bugs were
introduced affecting the ability to write lists, records, and other non-text
data to files from Applescript (of course, you're not running 9.1 on those
68030s).
I have been doing things similar to what you are doing. For a working example
check out <shameless plug>www.fyhome.com</shameless> - the shopping cart and
the wallpaper estimate features are fully Applescript and use read/write to
text files to store and retrieve data. There are also many behind the scenes
things being done with Applescript and text files to manage and grow the
site. I would love to trade notes with you on or off list.
Jeff Baumann
email@hidden
www.linkedresources.com
Comparing MHz between the G4 and Pentium is like comparing the popular vote
between Bush and Gore; it's interesting, but it isn't what matters.
In a message dated 1/29/01 7:20:15 AM, you wrote:
>
Hi Scripters,
>
>
I'm developing a large network and all CGI scripts and network applications
>
are being developed using AppleScript. It makes extensive use of databases,
>
but the network is being built using multiple low-end Macs (ie. 68030's,
>
etc), each with 8MB of RAM or more. Running FileMaker or a similar large
>
database solution is not an option.
>
>
I've been creating proprietary databases where the internal structure is
>
very flexible, with records having only fields that are needed at the time,
>
so different records will have different fields. Also, each database has
>
multiple sections (records and lists WITHIN records and lists, and so on).
>
>
My problem is that the time it takes to read a database consisting of 1000
>
records takes a L-O-N-G time, holding up the operations of the network for
>
a minute or so. Simply unacceptable, as this delay adds up with multiple
>
operations for a single client.
>
>
I've been using 'open for access' to create the files, then 'save/read
>
data' osax to read and write data to the files. It's works well, but I
>
can't figure out how to PARTIALLY read a file to speed up the process.
>
Also, updating a file currently involves reading the entire file to a
>
variable, updating the variable, then overwriting the file with the updated
>
variable. This works well, too, but it's S-L-O-W sometimes.
>
>
If you can provide any assistance or tips, I'd love to hear from you. Also,
>
if you're interested in working with me directly on this project, I could
>
use the help. Please write me at: Ted Wood <email@hidden>.
>
>
Thanks for any help.
>
>
Ted