home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
filutl
/
what20.arc
/
README
next >
Wrap
Text File
|
1988-08-14
|
1KB
|
39 lines
Here is a Unix utility (with source) for MS-DOS. I compiled with MSC 5.1,
but it is ANSI C with only file opening MS-DOS specific code.
It looks for a key text string in a file (any file: source text, binary
object, or executable). When the key string @(#) is found, all following
text up to a newline, null, double quote, or backslash is printed.
Try:
what what.com
Why what? First of all, to identify executable files. This utility
lets you know what version an executible is. It is also very useful for
library routines, both for checking which version is used and also to
see what routines actually get loaded at link time.
To use what in C, include a static character string like this:
static char *ID = "@(#)id.c: version 12.8 74-04-12 Fred Rogers";
in any module to be compiled (see attached source for example).
The static is used to avoid conflicts with other ID's in other modules.
The same idea can be used for assembler:
CONST SEGMENT
$SG101 DB '@(#) sline.asm: PC Graphics Library 1.0 88/06/15 Copyright '
DB '1988 R. Coates', 00H
CONST ENDS
This would be handy if people sending things to comp.binaries.ibm.pc used
this, then the executibles can be easily identified even if the original
distribution were lost, or confused with updates.
The .COM file included uses MS-DOS wildcard expansion, so
what *.exe
should work.
Rick Coates