Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I wanted to define a file format, how would I go about that?

Tags:

file-format

Say I come up with some super-duper way of representing some data that I think would be useful for other people to know about and use. Assume I have a 'spec' in some form, even if it might not be a completely formal one: ie, I know how this file format will work already.

How would I then go about releasing this spec to get comments and feedback based on it? How would I get it 'standardised' in some form?

like image 728
Matthew Scharley Avatar asked Oct 15 '22 13:10

Matthew Scharley


1 Answers

Specifying file formats is difficult. If the data you want to store is trivial, it tends to be trivial. In general however, this is hardly the case. You can use the RFC structure and keywords, but I always found specifying a fileformat in prose a slow, difficult and boring task, also because reading it is likewise difficult.

My suggestion, if you want to follow this way, is to focus on blocks of information. Most of the difficuly is for entities that are optional, and present only if another condition happens, so try to exploit this when partitioning your data.

The best spec, IMHO, is real code with an uberperfect testsuite.

As for standardization, if enough people use it, it becomes a de-facto standard. you don't need an official stamp for it, although when the format is used enough, you could benefit from an official mime type.

To talk about it, well, it depends. I found useful to talk in terms of "object oriented" entities, and also in terms of relationships. Database-like diagrams are very useful on this respect.

Finally, try to find a decent already standard alternative first, or at least try not to deal with the raw bits. There are a lot of perfect container formats out there that free you of many annoying tasks. The choice of the container depends on the actual type of file format (e.g. if you need encryption, interleaving, transactions, etc).

like image 119
Stefano Borini Avatar answered Oct 20 '22 16:10

Stefano Borini