• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error: Stack overflow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error: Stack overflow


  • Subject: Re: Error: Stack overflow
  • From: John Delacour <email@hidden>
  • Date: Wed, 30 Apr 2003 10:41:09 +0100
  • Mac-eudora-version: 6.0a16

On 4/29/03 10:12 PM, "Shane Stanley" <email@hidden> wrote:

>> I have used this routine for 15 years.

Use it on a system pre-10.2 with a file that's shorter than your chunk size.
> I think you'll find it falls down rather badly.

You should try things before induging in such nugatory thoughts. It works perfectly well in 9.2.2. For users of OS 7.1 - 8.6 see below


At 12:08 am -0700 30/4/03, Paul Berkowitz wrote:

Before John ever answered, I supplied an equivalent script that would not
fail on short chunks. It has been ignored here ... Here it is again...

But it's _far_ too long-winded Paul! The routine below will work on any system since Read Write Commands was born round about Os 7.1. Apple have appropriated it and hidden it, but update it ??! Perish the thought!


global f -- for the purposes of this test
(* Create a test file *)
set f to "" & (path to temporary items) & "short.txt"
open for access file f with write permission
write "one word" to file f
close access file f
-------------------------------------

(* Read short file in large chunks *)
set nbytes to 30000
open for access file f
set eof_ to get eof file f
if eof_ is less than nbytes then set nbytes to eof_
repeat
try
set chunk to read file f for nbytes
on error
exit repeat
end try
end repeat
close access file f
chunk -- => "one word"
-------------------------------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Error: Stack overflow
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Error: Stack overflow (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Scripting an AppleWorks database
  • Next by Date: Re: Error: Stack overflow
  • Previous by thread: Re: Error: Stack overflow
  • Next by thread: Re: Error: Stack overflow
  • Index(es):
    • Date
    • Thread