Binary Files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Binary Files
# 1  
Old 06-21-2004
Network Binary Files

Here's the problem...

I'm using a simulator on UNIX, and it requires a filename where bits are stored, it should read them out and do whatever with them at that point..

So what i'm trying to do is make a binary file on UNIX. On my PC i can use MSDEV, or any of my C++ compilers to generate a .bin file, is there a way to easly do this on UNIX?

I tried making a binary file on the PC and FTP-ing it over to my UNIX box, but the simulator treated it as a text document and read them it as a bunch of 30's and 31's (ASCII 0's and 1's).

Any ideas anyone?
# 2  
Old 06-21-2004
Well, what I'm looking for is indeed a binary data file for the simulator... I understand little of UNIX because I only use it for work, and have had little exposure to it outside of that.

All I know of the system is it's called solaris, it's not a Linux system, I don't know what hardware it runs on, or how to find that out.

I'll try to be a little more specific on what i'm attempting:
* I need a file full of bits. (so i'm assuming that has to be a binary file).
* The file will be opened by the simulator and read out 1 byte at a time.

When I made a text file on emacs and wrote in it:
11001110000...

The simulator opened the file and read out the first 8 char's (left to right) and treated them as ASCII chars instead of reading out the first 8 bits and treating it as a byte of data like I had hoped for.

I'm sorry if i'm not making this very clear... I thought it would be an easy thing to just make a file that the simulator could read...
# 3  
Old 06-22-2004
MySQL

Yup, writting the code worked to make my binary data file. Smilie
Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Binary files diff

Hi I am very happy to joined this group!!! I need your suggestion for get it resolved my issue. I have two class files both class files are same, there is no diff in both two files. Both 2 files were compiled in Linux environment with different type of OS. When i am using diff command,... (13 Replies)
Discussion started by: suresh1256644
13 Replies

2. Programming

reading binary files

#include <stdio.h> /* typedef struct { char name; int number; float balance; } acct_info_t; */ int main() { FILE *fptr; fptr = fopen("acct_info", "r"); int magic = 5; fseek(fptr,3,SEEK_SET); fread(&magic,sizeof(int),1,fptr);... (7 Replies)
Discussion started by: robin_simple
7 Replies

3. Shell Programming and Scripting

Binary files

Hi All,Is there anyway I can conver the binary file to ascii. I don't know the binary file format. file command just lists this as "data" file and when I view it has a lot of non-printable characters.Can I write any command equivalent to wc -l to find out the number of rows in the file?Can I use... (4 Replies)
Discussion started by: rahulkav
4 Replies

4. Programming

Editing binary files

I am working in C and need a solution for below problem: I have a binary file, which needs to be edited in such a way no data is loss. For example i have to insert 3 bytes of data at some position without changing the contents of the file. if file has data as:... (2 Replies)
Discussion started by: junaid.nehvi
2 Replies

5. UNIX for Dummies Questions & Answers

Comparison between binary files

Hello, I would like to know if we can compare binary(non text) files in unix eg. exes Thanks Saurabh (3 Replies)
Discussion started by: smehra_20
3 Replies

6. Shell Programming and Scripting

Reg : binary files

HI Friends, My actual requirement is to find out the binary files except txt/gif from parent and subdirectories. so,i have to write unix shell script. Any one please suggest me on this how to write script for this or any other alternate way is there to find out. Thanks & Regards, Srujana (13 Replies)
Discussion started by: srujana
13 Replies

7. Shell Programming and Scripting

search for files excluding binary files

Hi All, I need a solution on my following find command find ./.. -name '*.file' -print BTW This gives me the output as belows ./rtlsim/test/ADCONV0/infile/ad0_dagctst.file ./rtlsim/test/ADCONV0/user_command.file ./rtlsim/test/ADCONV0/simv.daidir/scsim.db.dir/scsim.db.file... (2 Replies)
Discussion started by: user_prady
2 Replies

8. UNIX for Dummies Questions & Answers

Joining two or more binary files together

Is there a way to join two or more binary files together without corrupting the data? I've searched the forums, and googled etc. but the only commands that get mentioned are 'cat', which only works for text files and 'join'. According to the man pages join is a 'relational database operator',... (5 Replies)
Discussion started by: Boothy
5 Replies

9. UNIX for Advanced & Expert Users

Files Linked With A Binary

Hi, What is command in unix to find what are all the files linked with an executable binary. Thanks in advance. Rgds, Omkumar (2 Replies)
Discussion started by: tc.omkumar
2 Replies

10. UNIX for Dummies Questions & Answers

Binary Files

Does any one know how to view a binary file as it is (in 1s and 0s) on unix environment? (1 Reply)
Discussion started by: devildivine
1 Replies
Login or Register to Ask a Question