[squeak-dev] FileStream size limitation?

Benoit St-Jean bstjean at yahoo.com
Sat Aug 31 23:38:46 UTC 2013


You could have gone the other way around!  Like this:

| fs |
fs := FileStream fileNamed: '1-2729.rtf'.
oc do: [:each | fs nextPutAll: each asString].
fs close.


That way, regardless of the size of your collection, it will always work!



 
-----------------
Benoit St-Jean
Yahoo! Messenger: bstjean
Blogue: endormitoire.wordpress.com
A standpoint is an intellectual horizon of radius zero.
(Albert Einstein)


________________________________
 From: Squeak List <squeaklist at yahoo.com>
To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org> 
Sent: Saturday, August 31, 2013 4:49:02 AM
Subject: [squeak-dev] FileStream size limitation?
 


Hello,

I have an OrderedCollection with 24,576 elements.

A bunch of musical notes basically: each of the 24,576 elements is like: 

#('eo6' 0.25 500)

for example.


Goal: I would like to turn that *entire* OrderedCollection into a single MIDI file. 


However, there seems to be some sort of size limitation that I do not see how to get around.

1) Even before getting to the MIDI part, I tried:

FileStream fileNamed: '1-24576.rtf'
do: [:stream | stream nextPutAll: ((oc copyFrom: 1 to:24576) asString)].

which creates a nice file of 48.8KB size.
And opening the file, it ends with: 

#('c#o6' 0.25 500) #('d...etc...
which is not what I expected.

2) If I do:

FileStream fileNamed: '1-2729.rtf'
do: [:stream | stream nextPutAll: ((oc copyFrom: 1 to:2729) asString)].

it works fine: ending tidily with the expected: 
#('c#o6' 0.25 500))

3) But,

FileStream fileNamed: '1-2730.rtf'
do: [:stream | stream nextPutAll: ((oc copyFrom: 1 to:2730) asString)].

is where this starts:

#('c#o6' 0.25 500) #('d...etc...


This exact same problem happens when making MIDI files: there seems to be a size limitation around 48.8KB.

Aside from MIDI, is FileStream just the wrong class to use for anything larger than creating a 48.8kb text file (.txt or .rtf)? Or how can I get around this restriction?

Any suggestions are most welcome. 


Thanks,
ken

Windows 7 - 64 bit


Squeak4.4
latest update: #12319
Current Change Set: Unnamed
Image format 6505 (32 bit)

Squeak.exe
Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.331]
Win32 built on Aug 22 2013 10:20:54 Compiler: 3.4.4 (cygming special, gdc 0.12, using dmd
 0.125)
platform sources revision VM: r2776 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130831/27e57824/attachment-0003.htm


More information about the Squeak-dev mailing list