Best practices for writing data to disk.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Best practices for writing data to disk.

John E.
I'm having trouble finding out if classic squeak methods work in this case.

Can anyone recommend a best practice if I have an object that holds a
large, procedurally created, orderedCollection and I want to be able
to read/write it from a file (text or binary)?

Specifically. I have an object called "PrimeBank", that holds a huge
set of prime numbers.  Its methods can grow this set at any time.  As
the set gets larger, I'd like to be able to write it out to a file and
read it in when I'm running the code on another image.

Ideally I think I'd like the file to be human readable and editable.

- John E.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Best practices for writing data to disk.

csrabak

John,

Your description seems to point to a simple streaming over your collection would suffice (e.g SBE 10.3 to 10.4).

Are you observing any perfomance hit or something else?

Em 17/08/2009 07:49, John Escobedo < [hidden email] > escreveu:


I'm having trouble finding out if classic squeak methods work in this case.

Can anyone recommend a best practice if I have an object that holds a
large, procedurally created, orderedCollection and I want to be able
to read/write it from a file (text or binary)?

Specifically. I have an object called "PrimeBank", that holds a huge
set of prime numbers. Its methods can grow this set at any time. As
the set gets larger, I'd like to be able to write it out to a file and
read it in when I'm running the code on another image.

Ideally I think I'd like the file to be human readable and editable.

- John E.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
< br />

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Best practices for writing data to disk.

Stéphane Ducasse
In reply to this post by John E.
for simple matter
you can use storeOn:/ readFrom protocol
store one element per line
and use readFrom: one each line to load back


On Aug 17, 2009, at 12:49 PM, John Escobedo wrote:

> I'm having trouble finding out if classic squeak methods work in  
> this case.
>
> Can anyone recommend a best practice if I have an object that holds a
> large, procedurally created, orderedCollection and I want to be able
> to read/write it from a file (text or binary)?
>
> Specifically. I have an object called "PrimeBank", that holds a huge
> set of prime numbers.  Its methods can grow this set at any time.  As
> the set gets larger, I'd like to be able to write it out to a file and
> read it in when I'm running the code on another image.
>
> Ideally I think I'd like the file to be human readable and editable.
>
> - John E.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project