Use these methods in your class.loadStonFromFile: aDataFilenameString| data |data := STON fromStream: ((self dataFileNamed: aFilenameString) readStream).^datapersistAsSton: anObject toFile: aDataFilenameString (self newDataFileNamed: aFilenameString) writeStreamDo: [ :out | out << (STON toString: anObject) ]dataFileNamed: filename"For an existing file"^ (FileLocator imageDirectory / 'data' / filename) fullPath asFileReferencenewDataFileNamed: filename| file |file := (FileLocator imageDirectory / 'data' / filename ) fullPathasFileReference.file writeStream close.^ fileUsage:"Saving"self persistAsSton: someDataStructure toFile: self newDataFileNamed: 'persist.dat'"Loading"someDataStructure := self loadStonFromFile: self dataFileNamed: 'persist:dat'HTHPhilOn Wed, Nov 2, 2016 at 3:38 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
> On 2 Nov 2016, at 15:29, sergio ruiz <sergio.rrd@gmail.com> wrote:
>
> Hmm��� i need to look at this ..
>
> i can just burp out all my objects with ston and suck them back in on the local machine..
Just try it ;-)
�� STON put: myObjects onStream[Pretty]: fileStream.
�� STON fromStream: fileStream.
https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBo ok/lastSuccessfulBuild/ artifact/book-result/STON/ STON.html
STON has already seen quite some usage, so you should be good.
> On November 2, 2016 at 10:25:51 AM, phil@highoctane.be (phil@highoctane.be) wrote:
>
>> Keeping data in image with a STON export would be good enough:
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101