Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to compare so files ...

5 views
Skip to first unread message

robeson

unread,
Nov 19, 2009, 9:53:04 AM11/19/09
to
I got two so files, I want to know if these two so files has same size
(Actually I want to know whether these two so files is the same
version), but ls -l show file size seems not right.
When I ftp one so file from A to B, the file size changed ....
Anyone could help me ?

hume.sp...@bofh.ca

unread,
Nov 19, 2009, 10:05:03 AM11/19/09
to
robeson <junf...@live.cn> wrote:
> When I ftp one so file from A to B, the file size changed ....
> Anyone could help me ?

Are you FTPing the files in binary or text mode?

--
Brandon Hume - hume -> BOFH.Ca, http://WWW.BOFH.Ca/

Richard B. Gilbert

unread,
Nov 19, 2009, 10:26:01 AM11/19/09
to

What is a "so file"? I've been working with various flavors of computer
and O/S since about 1966! This is my first encounter with the term "so
file"!

Thad Floryan

unread,
Nov 19, 2009, 10:48:53 AM11/19/09
to

Never compiled/linked/run a program on a UNIX computer?

"so" = shared object: <http://www.file-extensions.org/so-file-extension>

On a Solaris system, do this:

$ ls /usr/lib | grep "so" | wc -l

over 870 "so" files on my Solaris 10 system.

Richard B. Gilbert

unread,
Nov 19, 2009, 11:04:48 AM11/19/09
to

Thank you!

Your original problem may be due to using FTP in "text mode" rather than
in binary mode. AIRC text mode is the default and you must say "bin" to
switch to binary mode. The most probable cause for the change in size
is that the receiving FTP program will insert the customary local line
terminator at the end of each text record. This will be <lf> for Unix,
<cr><lf> for Windows, and used to be <cr> for MacIntosh, etc.

Dave

unread,
Nov 19, 2009, 7:44:30 PM11/19/09
to

I guessed what a 'so' file was, but it is hardly a well used term. Most people
would say they copied a shared library, not a 'so file'.

BTW, grep has a -c option, which counts the number of times the expression is
found, without the need to pipe to 'wc'.


--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.

Thad Floryan

unread,
Nov 19, 2009, 8:43:32 PM11/19/09
to
On 11/19/2009 4:44 PM, Dave wrote:
> Thad Floryan wrote:
>> [...]

>> $ ls /usr/lib | grep "so" | wc -l
>>
>> over 870 "so" files on my Solaris 10 system.
>
> I guessed what a 'so' file was, but it is hardly a well used term. Most
> people would say they copied a shared library, not a 'so file'.
>
> BTW, grep has a -c option, which counts the number of times the
> expression is found, without the need to pipe to 'wc'.

Interesting, and thank you!

Lots of UNIX commands/programs have changed over the almost 40 years I've
been using them; old habits die hard. :-)

Another one is the (new, circa early 1990s) implicit -print option in
many versions of find if one's only searching for, say, files.

VANOSPAM

unread,
Nov 19, 2009, 9:17:34 PM11/19/09
to

The best way is to use the "sum" command. If the files are the same,
the check sum that sum produces will be the same.

Brad

Dave

unread,
Nov 20, 2009, 5:33:09 AM11/20/09
to

I would suggest 'cksum' is better than 'sum', as the former is portable, and the
latter is implementation dependent. Two different machines can give a different
'sum' to the same file (I found this out when testing software on a wide variety
of Unix operating systems). In contrast, all machines will give the same result
for 'cksum'.

Clearly using an md5 checksum would give a higher degree of confidence, but it
is more computationally intensive.

Dave

David Combs

unread,
Nov 27, 2009, 8:20:31 PM11/27/09
to
In article <zYKdnQQli-Te8ZjW...@giganews.com>,

Is it true that text mode works fine as you're going from
some kind of unix/linex to eg solaris?

David


David Combs

unread,
Nov 27, 2009, 8:23:59 PM11/27/09
to
In article <4b06...@212.67.96.135>, Dave <f...@coo.com> wrote:
>VANOSPAM wrote:
>> On Nov 19, 9:53 am, robeson <junfei...@live.cn> wrote:
>>> I got two so files, I want to know if these two so files has same size
>>> (Actually I want to know whether these two so files is the same
>>> version), but ls -l show file size seems not right.
>>> When I ftp one so file from A to B, the file size changed ....
>>> Anyone could help me ?
>>
>> The best way is to use the "sum" command. If the files are the same,
>> the check sum that sum produces will be the same.
>>
>> Brad
>
>I would suggest 'cksum' is better than 'sum', as the former is portable, and the
>latter is implementation dependent. Two different machines can give a different
>'sum' to the same file (I found this out when testing software on a wide variety
>of Unix operating systems). In contrast, all machines will give the same result
>for 'cksum'.
>
>Clearly using an md5 checksum would give a higher degree of confidence, but it
>is more computationally intensive.

And probably requires a lot more to learn, too, getting
into all that crypto stuff.

>
>Dave

Richard B. Gilbert

unread,
Nov 27, 2009, 8:46:05 PM11/27/09
to

Text mode works for sending/receiving text files. For binary files, you
must transfer in binary mode.

Richard B. Gilbert

unread,
Nov 27, 2009, 9:06:21 PM11/27/09
to

Text mode works fine if you are sending or receiving text.

If you are sending or receiving binary files, you must say "bin" to put
the connection into binary mode. To switch back, I think you say ascii.
It has been a few years since I last used FTP. You can say "help" at
the prompt. The "help" you get may or may not be helpful but that's all
there is. If you can't figure it out you can hire a consultant.

hume.sp...@bofh.ca

unread,
Nov 27, 2009, 9:57:50 PM11/27/09
to
David Combs <dkc...@panix.com> wrote:
> And probably requires a lot more to learn, too, getting
> into all that crypto stuff.

Not at all, just use digest.

% which digest
/usr/bin/digest
% digest -a md5 /lib/libc.so
659fc0b7631c81bbb504231bc991813f

0 new messages