Question:
When I use the diff operation in UNIX, it says that "binary files differ"?
Steffie
2013-01-14 12:09:26 UTC
so I have myfile.c
and I used gcc -Wall myfile.c

then I used diff myfile.c teacherfile.o

in order to compare the two, but I get "Binary files myfile.c and teacherfile.o differ." what does that mean?
Five answers:
Runa
2013-01-14 12:11:30 UTC
It means they are not the same type of file. One is an object file that has been compiled and is waiting to be assembled and the other is a text file. To use diff the files should be of the same type, otherwise they duff is meaningless.



Diff is meant to be used on text or source files. Not on binaries. Use them to compare source code, not compiled programs. Even if it could do this you would not be able to read the binary output. Look at the man page.



You can use



cmp -l file1.bin file2.bin | awk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}'



if you want the binary offset.
sheru
2016-10-16 03:10:03 UTC
Binary Files Differ
?
2013-01-14 12:18:23 UTC
a.out is the executable form of myfile.c. To properly use diff, you need to compare two files of the same extension. Here's how to use the diff command: http://www.computerhope.com/unix/udiff.htm



I don't understand why you're trying to compare executables in the first place actually.
anonymous
2013-01-14 12:13:27 UTC
It means at least one of the files contains binary data -- teacherfile.o in this case.



You are comparing the source code in myfile.c with the compiled output of a different program in teacherfile.o.



If you have a file called teacherfile.c you could compare myfile.c with it to see the differences between the two source code files.
anonymous
2016-04-11 04:26:44 UTC
For the best answers, search on this site https://shorturl.im/avP00



John won't let an opportunity go by that shows us that Jesus is God. He is omniscient -- He knows everything. He knew exactly what was going to happen, and He didn't wait for His enemies to get Him. He wasn't hiding behind an olive tree; he went out the gate and met them when they were on their way in. Christ was so humble and so willing in His self-sacrifice. Jesus initiated the confrontation, not Judas. Judas didn't even have an opportunity to open his mouth. He went out of the gate to meet them as they were coming to get Him. In His omniscience, He had seen Judas make his deal, He had seen them all leave Jerusalem, go down the hill, and then up the Mount of Olives. Then He walked right out and met them. This is the majestic courage of Jesus Christ. What magnificent boldness He displayed in going to the cross for us! "...Jesus saith unto them, I am He...." The "He" isn't present in the Greek. So Jesus just says, "I am." Whose name is that? It is God's name. "As soon, then, as He had said unto them, I am..., they went backward, and fell to the ground." Jesus wanted us to know Judas was there to show that Judas had no power. All Jesus had to do was say His name and they all went down. The other Gospels dwell on Jesus' agony -- on His knees on the ground in anguish. But not in John's Gospel. Jesus is standing and the whole Roman army is on the ground. Jesus Christ is God so they fell in fear!!!!!!!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...