|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
I am wondering if anyone on this forum can read a binary file.
If there is a way to do so, I would really like to know how to do it and what is contained in this file. I am curious on what does it take to accomplish this. |
|
#2
|
||||
|
||||
|
Simple and easy, all you have to do is use the 'rb' or read binary flag instead of read i.e.
gif = file('sample.gif', 'rb').read() Mark. |
|
#3
|
|||
|
|||
|
I take it that you are referring to using Python to accomplish correct? Could you be a little more specific. Thank you
|
|
#4
|
|||
|
|||
|
No he can't be more specific ... he gave you all the code you need get the data into a variable. What more could you possibly ask for?
|
|
#5
|
|||
|
|||
|
hmmmm, so you are a programmer? I am not. The obvious to you is not obvious to me. That is why the question was asked. Now if you asked me how would a person stop a Cisco 5850 for sending dual dial tones I could answer that, but this is not about that subject. I wanted information on a subject that I am not an expert on.
|
|
#6
|
||||
|
||||
|
Yup, all programmers here, well most of us! Nearly all have some programming experiance
. Anyway yes, small as the code is, Python makes it amazingly easy... Mark. P.S. if i ever have a problem with that (Cisco 5850) i'll know where to come ![]() |
|
#7
|
|||
|
|||
|
I think I understood what he asked.
He is asking that if when faced with a random textfile you can just open it with any text editor and read what's in it, can you do the same with a binary file. The short answer is no. I you have no idea whatsoever in what format the data in the file is, you can't use it. It like being dumped into japan without a dictionnary and being expected to understand japanese. The long answer is that it is possible but that require a lot of efforts and time. It is called reverse-engineering. For instance, the Microsoft Office binary formats have been understood and used in the excellent OpenOffice.org |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > can anyone a binary file? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|