Post subject: Binary file format description format
Joined: 9/17/2009
Posts: 18
Location: Hungary
Is there a language that can be used to describe the format of binary files? Currently when people need to describe a file format, they use tables and maybe structures in a particular programming language (C). If you want to use the format in a language with no equivalent, you must code it manually. There seem to be attempts at it but none are in everyday use. Wikipedia articles for common file formats (like PNG, BMP or WAV) don't have links to this kind of description while they do contain links to pdf's and table-based descriptions.
Joined: 7/26/2006
Posts: 1215
The point of the tables and structures is to show the order the data is stored in and the size each piece of data should take. What language are you using to read in a file that somehow doesn't support reading in things like byte arrays, integers, etc.? Even if those aren't supported for whatever reason, nothing is stopping you from putting the contents of a file into a giant string or whatever and then manipulating that. Anyway there's no such thing as an API for every file format, but there might be ones for similar files (e.g. one for all image files, another for all sound files, etc). And if you are using a language that doesn't have structures or classes for serious work, my advice is to learn a better language.