• 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: Buffered-Unbuffered data in AS?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buffered-Unbuffered data in AS?


  • Subject: Re: Buffered-Unbuffered data in AS?
  • From: "Philippe GRUCHET" <email@hidden>
  • Date: Thu, 04 Jul 2002 17:22:09 +0100

Hi!

Is there anybody else to do this test?
Thank you very much!

Strange.
I can read up to:

--start script
set theString to " 123456789ABCDEF"
repeat 6 times
set theString to theString & theString
end repeat
-- theString is now 1K characters or one block
set f to open for access file "Macintosh HD:foo.txt" with write permission
repeat 2975 times --and not 8192 times
write theString to f
end repeat -- f now contains 2.9Mb of data
close access f

try
set f to open for access file "Macintosh HD:foo.txt"
set s to read f
close access f
length of s -- result is 3046400 and not 8388608
on error
close access f
display dialog ,
"Out of memory" buttons "Quit" default button 1 with icon 2
end try

--end script

> From: Chris Espinosa <email@hidden>
>
> Could you verify that you're not just running into the Script Editor's
> limitation on displaying data in the event log and results window? Our
> internal testing shows that AppleScript is able to read much larger
> files -- the following test worked up to 16Mb but failed (woth an
> out-of-memory error) at 32Mb:
>
> set theString to " 123456789ABCDEF"
> repeat 6 times
> set theString to theString & theString
> end repeat
> -- theString is now 1K characters or one block
> set f to open for access file "Macintosh HD:foo.txt" with write
> permission
> repeat 8192 times -- change this number
> write theString to f
> end repeat -- f now contains 8Mb of data
> close access f
>
> set f to open for access file "Macintosh HD:foo.txt"
> set s to read f
> close access f
> length of s -- should be 8388608
>
> Chris Espinosa
> Apple

>> Right!
>> I've just found a size limit: lower than 20K from an external data
>> fork.
>> From 20K, AS doesn't handle buffered data correctly.
>> And from inside the Script Editor (events window), we can see that
>> data are not loaded at all!
>>
>> So, from 20K and more, data must be cut into segments.
_______________________________________________
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.

  • Prev by Date: Re: Urgent Need help with Script!
  • Next by Date: CGI and Offset query
  • Previous by thread: Re: Buffered-Unbuffered data in AS?
  • Next by thread: insert a literal quote
  • Index(es):
    • Date
    • Thread