[comp.sys.mac.hypercard] Read to/From file

benjamin_kuo@pedro.UUCP (Benjamin Kuo) (07/31/88)

If anyone at Apple or elsewhere can take note of a slight problem, which may 
not be a bug, but is nonetheless very annoying, I'd greatly appreciate it. 
  
According to the 1.2 new release stack, HyperCard cannot APPEND text files. 
It can only read in whole files, and dump out whole files--there is no way 
to add to an existing file. 
  
A friend of mine, who is writing a "computer logging" program for monitoring 
student use of their computer lab, brought this to my attention.  If there 
is any way to easily append a file without having to create a new file 
every time you need to add information (about 30 times a day, every day, all 
year), I'd love to know (so I can pass that information on). 
  
Thanks in advance, 
Benjamin Kuo 

dan@Apple.COM (Dan Allen) (08/07/88)

In article <572@pedro.UUCP> benjamin_kuo@pedro.UUCP (Benjamin Kuo) writes:
>According to the 1.2 new release stack, HyperCard cannot APPEND text files. 
>It can only read in whole files, and dump out whole files--there is no way 
>to add to an existing file. 

Write you are (no pun intended!)  HyperCard can NOT append.  However, if
you use read and write with a buffersize of 16384, it goes pretty quick.
You could read in a file with
	read from file fileName for 16384
and write it out, and then continue to write your stuff.

But this is a bad solution.  The best solution is to write a simple XCMD
that does the appending for you.  Chances are that if you are doing
stuff with files 30 times a day, you are a prime candidate for a set of
several XCMDs which would most likely improve your performance anywhere
from a factor of 2 to a factor of 200, depending upon what you are
doing.  If this is a commercial venture, then write XCMDs.  They are
very useful.

Dan Allen
Apple Computer