home *** CD-ROM | disk | FTP | other *** search
- ############################################################################
- #
- # File: iversion.icn
- #
- # Subject: Program to show icode version
- #
- # Author: Ralph E. Griswold
- #
- # Date: September 2, 1991
- #
- ###########################################################################
- #
- # This program reports the version of Icon icode files whose names
- # are supplied, one name per line, from standard input.
- #
- # The method is necessarily somewhat heuristic and may not work on
- # all systems and for very old icode versions.
- #
- ############################################################################
-
- procedure main()
- local name, file, icode, okay
-
- while name := read() do {
- writes(name, ": ")
- file := open(name,"u") | {
- write("cannot open")
- next
- }
- okay := &null
- while icode := reads(file,30000) do # enough for most UNIX headers
- icode ? {
- while tab(upto('I') + 1) do {
- if any('5678') then {
- write(tab(upto('\0')))
- okay := 1
- break
- }
- }
- }
- if /okay then write("no version; may not be icode file")
- close(file)
- }
-
- end
-
-
-