![]() |
| ||
| Reading binary file without knowing file format Dear all, I have read a lot topics about reading binary files but I didn't find something about my problem. How possible is it to read a binary file that you don't know the file format? I am sure that there are at least chars and float numbers. Thanks a lot!! |
| ||
| Re: Reading binary file without knowing file format use "fopen()" to open the file, and specify "read, binary" as the mode. FILE * fp; note the following: Quote:
. |
| ||
| Re: Reading binary file without knowing file format It's quite a challenge decoding a binary file with an unkown format! In general, it's not possible. How do you know if the first two bytes are the characters AB or the 16-bit integer with decimal value 1106 (assuming an ascii representation)? You might want to view the file in a hex/ascii viewer. |
| ||
| Re: Reading binary file without knowing file format Thanks for your answer, I have the following code, I will check also your link, I use linux but I can't see an text that should be in the binary. #include<stdio.h> |
| ||
| Re: Reading binary file without knowing file format Quote:
---------------------------------------------------------------- It is free program and it was producing text files but now they change it to produce binary files in order for another program to reads the files but I don't want the other program. |
| ||
| Re: Reading binary file without knowing file format So you basically want to write a program that will translate the new format binary file into the old format text file? If it's a free program, can you get the source? Or can you find a description of its binary format online? |
| ||
| Re: Reading binary file without knowing file format Quote:
|
| ||
| Re: Reading binary file without knowing file format You may be able to figure it out with some detective work. Try running the old program and the new program in such a way that they should produce the same data. Then compare the files (viewing the binary file in a hex editor). But they could have added some things or moved some things so it could be difficult to compare them. If you happen to do the above (generate the "equivalent" text and binary files), and they're not too big, zip and attach them. |
| ||
| Re: Reading binary file without knowing file format Quote:
|
| All times are GMT -4. The time now is 1:20 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC