D serialization temporary fixup?
John Colvin via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Oct 22 09:20:49 PDT 2015
On Thursday, 22 October 2015 at 16:15:23 UTC, Shriramana Sharma
wrote:
> I wanted a D equivalent to:
> http://doc.qt.io/qt-5/qdatastream.html
> https://docs.python.org/3/library/pickle.html
>
> and saw that one is under construction:
> http://wiki.dlang.org/Review/std.serialization
>
> But till it's finalized, I'd just like to have a quick but
> reliable way to store real and int data types into a binary
> data file and read therefrom. Is there such a solution? The
> size of the data is fixed, but especially since I have real
> values, I'd like to not write to limited fixed decimal text
> format.
Simple lumps of binary data can just be written directly using
http://dlang.org/phobos/std_file.html#.write or
http://dlang.org/phobos/std_stdio.html#.File.rawWrite
and there are corresponding functions for reading.
More information about the Digitalmars-d-learn
mailing list