Write struct to file

Chopin robert.bue at gmail.com
Sun Feb 26 15:22:38 PST 2012


Hello! OP here :)
I'm gonna be more precise why I want this.
I'm writing my own blog, I will write my own HTTP server etc. and 
the saving of the data myself. Everything will be done in D! Why? 
Learn D. I don't want to hear the reinvent the wheel :(, I think 
you learn a lot by doing thing like this.

So, when I POST a blog-entry, I will read it, and write it to a 
file. I don't want write strings in a file, like:

1--||--Title--||--The entry--||--Date

I have little knowledge about system programming, and writing raw 
files. But my dream was like:

SOME_INT_WITH_LENGTH_OF_STRUCT_TO_THE_RIGHT 
HERE_IS_THE_RAW_STRUCT 
SOME_INT_WITH_LENGTH_OF_STRUCT_TO_THE_RIGHT 
HERE_IS_THE_RAW_STRUCT etc.etc.etc.

Then read those structs in array :)

I thought this was kinda easy in C, but I could be very wrong! So 
I thought it must be super easy in D! I don't have the 
knowledge...

ae.utils.json <-- this will be not as "cool" as writing it raw 
binary? :p
Well. Thank you all for information, tips and tricks!!
Great community! Thanks!


More information about the Digitalmars-d-learn mailing list