Re: Reading and writing records
Re: Reading and writing records
- Subject: Re: Reading and writing records
- From: Philip Aker <email@hidden>
- Date: Sat, 25 Aug 2007 03:33:06 -0700
On 2007-08-25, at 02:03:43, Chris wrote:
The point is that if you want to use AppleScript list and record formatting in this way, you actually have to know the details of the binary file format for both lists and records and then concoct a few handlers to be able to do what AppleScript doesn't handle natively. And it's slow compared to all of the other choices.
I don't see why I need to know the binary format.
Because your question was:
"Does anyone have a code snippet for writing a list of records one at a time and reading them back one at a time until eof?"
I've got no problem writing and reading the records.
Ok, so you didn't have to ask the question.
It just seems strange that there is no way to check for eof.
get eof of f
in AppleScript doesn't have the same connotation as EOF in C so you'd have to check for the accumulated read size being greater than get eof of f. But it's an alien concept for data types like AppleScript lists and records.
I don't see what having fixed size records has got to do with anything when you are reading sequentially.
List and record formats don't have ending delimiters and neither do the data types they commonly contain. Therefore, if one writes a type of known size, then they can read back a known size as a type.
Bye.
Philip Aker |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden