SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old December 27th, 2003, 01:00 AM
manx manx is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 manx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up can anyone a binary file?

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.

Reply With Quote
  #2  
Old December 27th, 2003, 01:37 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #3  
Old January 5th, 2004, 04:52 PM
manx manx is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 manx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I take it that you are referring to using Python to accomplish correct? Could you be a little more specific. Thank you

Reply With Quote
  #4  
Old January 5th, 2004, 05:04 PM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
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?

Reply With Quote
  #5  
Old January 5th, 2004, 06:38 PM
manx manx is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 manx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #6  
Old January 5th, 2004, 06:49 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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

Reply With Quote
  #7  
Old January 24th, 2004, 01:15 AM
Azmodan Azmodan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 Azmodan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > can anyone a binary file?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway