<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">You could have gone the other way around!&nbsp; Like this:<br><br>| fs |<br>fs := FileStream fileNamed: '1-2729.rtf'.<br>oc do: [:each | fs nextPutAll: each asString].<br>fs close.<br><br><br>That way, regardless of the size of your collection, it will always work!<br><br><div><span><br></span></div><div>&nbsp;</div><div>-----------------<br>Benoit St-Jean<br>Yahoo! Messenger: bstjean<br>Blogue: endormitoire.wordpress.com<br>A standpoint is an intellectual horizon of radius zero.<br>(Albert Einstein)</div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Squeak List &lt;squeaklist@yahoo.com&gt;<br> <b><span
 style="font-weight: bold;">To:</span></b> The general-purpose Squeak developers list &lt;squeak-dev@lists.squeakfoundation.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, August 31, 2013 4:49:02 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [squeak-dev] FileStream size limitation?<br> </font> </div> <div class="y_msg_container"><br><div id="yiv0848670623"><div><div style="color:#000;background-color:#fff;font-family:tahoma, new york, times, serif;font-size:12pt;"><div>Hello,</div><div><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">I have an OrderedCollection with 24,576 elements.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"> <br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york,
 times, serif;background-color:transparent;font-style:normal;">A bunch of musical notes basically: each of the 24,576 elements is like: <br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">#('eo6' 0.25 500)<br></div><div style="color:rgb(0, 0, 0);font-size:16px;
font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">for example.<br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">Goal: I would like to turn that *entire* OrderedCollection into a single MIDI file. <br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">However, there seems to be some sort of size limitation that I do not see how to get around.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times,
 serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">1) Even before getting to the MIDI part, I tried:</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">FileStream fileNamed: '1-24576.rtf'<br>do: [:stream | stream nextPutAll: ((oc copyFrom: 1 to:24576) asString)].</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;
background-color:transparent;font-style:normal;">which creates a nice file of 48.8KB size.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">And opening the file, it ends with: <br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">
</div><pre> #('c#o6' 0.25 500) #('d...etc...</pre>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">which is not what I expected.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">2) If I do:</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">FileStream fileNamed: '1-2729.rtf'<br>do: [:stream | stream nextPutAll: ((oc copyFrom: 1 to:2729) asString)].</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times,
 serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">it works fine: ending tidily with the expected: 
</div><pre>#('c#o6' 0.25 500))</pre>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">3) But,</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">FileStream fileNamed: '1-2730.rtf'<br>do: [:stream | stream nextPutAll: ((oc copyFrom: 1 to:2730) asString)].</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times,
 serif;background-color:transparent;font-style:normal;">is where this starts:<br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">
</div><pre> #('c#o6' 0.25 500) #('d...etc...<br></pre>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">This exact same problem happens when making MIDI files: there seems to be a size limitation around 48.8KB.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">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?</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times,
 serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">Any suggestions are most welcome. <br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">Thanks,</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">ken</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times,
 serif;background-color:transparent;font-style:normal;">Windows 7 - 64 bit<br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">Squeak4.4<br>latest update: #12319<br>Current Change Set: Unnamed<br>Image format 6505 (32 bit)</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">Squeak.exe<br>Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.331]<br>Win32 built on Aug 22 2013 10:20:54 Compiler: 3.4.4 (cygming special, gdc 0.12, using dmd
 0.125)<br>platform sources revision VM: r2776 <br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"></div></div></div></div><br><br><br><br></div> </div> </div>  </div></body></html>