Re: ?stupid question?
Posted in 1996
Most people have clearly not come across mcs...
>From: David Williams <djw@smooth1.demon.co.uk>
>Date: Mon, 7 Oct 1996 18:43:04 +0100
>X-Informix-List-Id: <news.28993>
>
>Malcolm Weallans <onlinedbc@cix.compulink.co.uk> wrote:
>>I have worked with INFORMIX for 10 years and I have never heard of
>>anything called "mcs". That doesn't guarantee that it doesn't exist but
>>I think it is more likely to be something other than INFORMIX.
>>
>>> I am an absolute novice in this area, so please excuse my unworthy
>>> question.
>>>
>>> When running Informix on an AIX system is there deamon, patch, gateway
>>> or other such thing called "mcs" that has something to do with getting
>>> messages from the application to the database? Could someone give me
>>> an idea what this "mcs" thing is? (It may even be a microfocus thing
>>> I'm not sure.)
>
> Run the following line
>
> strings mcs | grep -i Version
>
> If the result contains the word Informix then it is an Informix thing.
Way back when, I wrote to the original questioner with the following...
---
Date: Fri Oct 4 09:15:10 1996
From: johnl@informix.com (Jonathan Leffler)
To: matsto@et.mohave.cc.az.us
On Solaris 2.4 and SVR3/SVR4 machines in general, mcs is a command for
manipulating the comments section of an executable (mcs(1)). I use it
periodically to reduce the size of my executables, using either 'mcs -c'
to compress all replicated strings to a single occurrence or 'mcs -d'
to remove them altogether.
I know of no other use for a command called mcs -- but I am not an expert
on AIX.
---
I should have added that I'm not an expert on MicroFocus either.
Expanding slightly, to suit a larger audience, the C compilers on SVR4 etc
leave #ident strings in the comments section of the executable. One source
of #ident strings are the headers used in compiling the program. Since
most C source files use <stdio.h>, for example, most object files end up
containing the strings for it. These are concatenated into the comments
section, using disk space to minimal advantage. For example, I have a
simple program called stb for stripping trailing blanks (yes, I know sed
also does the job). The output from ls(1) and what(1) is shown for the
original output from the compiler, for the compressed-comments result from
mcs, and for the deleted-comments result. Note that this is a small
program and the disk space benefit is marginal.
$ ls -l stb-rwxr-xr-x 1 johnl RAND 10740 Jun 24 13:39 stb
$ what stb
stb:
stb.l 1.1 92/05/09
ffilter.c 3.3 93/06/29
stderr.c 6.2 91/12/22
stdio.h 1.34 94/06/07 SMI
feature_tests.h 1.6 93/07/09 SMI
ncform 6.7 93/06/07 SMI
stdio.h 1.34 94/06/07 SMI
feature_tests.h 1.6 93/07/09 SMI
string.h 1.15 93/12/15 SMI
stdio.h 1.34 94/06/07 SMI
feature_tests.h 1.6 93/07/09 SMI
string.h 1.15 93/12/15 SMI
stdlib.h 1.24 94/03/28 SMI
stdarg.h 1.11 94/01/05 SMI
yywrap.c 6.2 93/06/07 SMI
$ mcs -c stb
$ ls -l stb-rwxr-xr-x 1 johnl RAND 10516 Oct 8 08:20 stb
$ what stb
stb:
stb.l 1.1 92/05/09
ffilter.c 3.3 93/06/29
stderr.c 6.2 91/12/22
stdio.h 1.34 94/06/07 SMI
feature_tests.h 1.6 93/07/09 SMI
ncform 6.7 93/06/07 SMI
string.h 1.15 93/12/15 SMI
stdlib.h 1.24 94/03/28 SMI
stdarg.h 1.11 94/01/05 SMI
yywrap.c 6.2 93/06/07 SMI
$ mcs -d stb
$ ls -l stb-rwxr-xr-x 1 johnl RAND 9980 Oct 8 08:21 stb
$ what stb
stb:
stb.l 1.1 92/05/09
ffilter.c 3.3 93/06/29
stderr.c 6.2 91/12/22
$
Taking a somewhat more significant program (NewEra fglc on Unix, with fully
debuggable build), we find 411 lines of output from what on the unmodified
executable, only 40 in the compressed-comment version, and none in the
deleted-comment version. The size drops by 11752 bytes from compressing,
and a further 1412 bytes after deleting. In an executable of about 1.9 MB
(don't forget that this one contains all debugging information), that is
not significant, even though 12 kB of disk space can, occasionally, be
significant, albeit a lot less significant now that multi-gigabyte drives
are available on PCs. In the days of 100 MB drives, it mattered. In the
non-debug build, the executable is 1.2 MB and the space saving is still 12
kB.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>