views:

62

answers:

5

I am assigned a project to create a new binary file structure for storing co-ordinate information coming out of a 3d CAD/CAM software. I would highly appreciate if you kindly point out some articles or books regarding creation of new binary file format. Thanks for your time :)

+3  A: 

I would start by taking a look at other similar file formats on wotsit.org. The site is for various different file formats and it contains links to their specifications.

By looking at other file formats you'll get ideas about how best to format and present information about your specification.

Brian R. Bondy
+1 nice resource
William
+1  A: 

If I had the same assignment, I would inspect something already existing, like .OBJ and then try to implement something similiar, probably with minor changes.

Kotti
+1  A: 

Short answer: Don't. Use XML or a text format instead for readability, extensability amd portability.

Longer answer: CAD/CAM has loads of 'legacy' formats around. I'd look to use one of those (possibly extending it if necessary). And if there's nothing suitable, and XML is considered to bloaty and slow, look at Binary XML formats instead.

Roddy
Don't use binary, unless of course the amount of data is huge. Expanding binary bytes into text, then adding all the surrounding XML markup, typically doubles the size of the data. Plus, you have to parse the XML to read it all back in. Sometimes a binary format is the best choice.
Loadmaster
A: 

I think that what you really need is to figure out what data you have to save. Then you load it into memory and serialize that memory

Here is a tutorial on serialization in C++. This page also addresses many issues with saving data

Eric
+1  A: 

There's a universal binary (and compact) notation called ASN.1. It's used widely and there are books about it available. ASN.1 can be compared to XML, but on some lower (more primitive yet more flexible) level than XML. And XML, especially binary XML mentioned above, would be of great help to you too. Also, if you have more than just one sequence of data to hold in your file, take a look at Solid File System as a container for several data streams in one file.

Eugene Mayevski 'EldoS Corp
Really awsome. u rock!!!
rwik