home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / file39a.zip / src / notes2.os2 < prev    next >
Text File  |  1993-08-05  |  52KB  |  1,302 lines

  1. Additional notes on the OS/2 port of Darwin's "file". Note that
  2. the email exchanges have been edited. Some of the edits are
  3. indicated with [[...]].
  4.  
  5. Some of the magic-file entries in the first OS/2 release were
  6. originally from Greg Roelofs (roe2@midway.uchicago.edu). These appear
  7. below. 
  8.  
  9. There are several notes from Jouni Miettunen (jon@stekt.oulu.fi) 
  10. with good ideas for enhancements. His magic-file entries for DOS 
  11. executables are included.
  12.  
  13. =============================================================================
  14.  
  15. From: Greg Roelofs (roe2@midway.uchicago.edu)
  16.  
  17. ...would like to be notified if and when my various
  18. guessed-at entries (particularly for lha and zoo) are defini-
  19. tively shown to be either correct or incorrect.
  20.  
  21. My magic file, in more or less the state in which it was posted
  22. to alt.sources (I think) several months ago, is appended below.
  23. Note that the image-format entries are from Cameron Simpson, on
  24. whose previously posted magic file mine is based.
  25.  
  26.  
  27. # From: cameron@spectrum.cs.unsw.oz.au (Cameron Simpson)
  28. # Newsgroups: alt.sources,comp.unix.programming
  29. # Subject: some useful additions to your magic file ...
  30. # Message-ID: <1992Mar21.055523.27025@usage.csd.unsw.OZ.AU>
  31. # Date: 21 Mar 92 05:55:23 GMT
  32. # Sender: news@usage.csd.unsw.OZ.AU
  33. # Organization: CS&E Computing Facility, Uni Of NSW, Oz
  34. #
  35. # This is simply a list of a few entries which seem missing from most systems'
  36. # magic files. The first 10 or so entries recognise and classify executable
  37. # scripts, which otherwise tend to be called C source etc. The last few entries
  38. # recognise a couple of common image formats, always useful when trolling for
  39. # users who are wasting disc space when things are tight.
  40. #    - Cameron Simpson
  41. #      cameron@cs.unsw.oz.au
  42. #
  43. 0    string        #!            exec()able script 
  44. >2    string        /bin/sh            - Bourne shell
  45. >2    string        /bin/ksh        - Korn shell
  46. >2    string        /usr/local/bin/zsh    - Paul Falstad's zsh
  47. >2    string        /usr/local/bin/ash    - NeilBrown's ash
  48. >2    string        /usr/local/bin/ae    - NeilBrown's ae
  49. >2    string        /usr/local/bin/perl    - Perl
  50. >2    string        /usr/bin/perl        - Perl
  51. >2    string        /bin/awk        - AWK
  52. >2    string        /bin/nawk        - new AWK
  53. >2    string        /usr/bin/nawk        - new AWK
  54. >2    string        /usr/local/bin/nawk    - new AWK
  55. >2    string        /bin/gawk        - GNU AWK
  56. >2    string        /usr/local/bin/gawk    - GNU AWK
  57. >2    string        /bin/csh        - C shell
  58. 0    string        GIF            GIF image archive 
  59. >3    string        87a            - version %3s
  60. >3    string        87A            - version %3s
  61. >3    string        89a            - version %3s
  62. >3    string        89A            - version %3s
  63. 0    long        0xffd8ffe0        JPEG image, big endian
  64. 0    long        0xe0ffd8ff        JPEG image, little endian
  65. 0    string        hsi1            HSI1 image (wrapper for JPEG?)
  66. #
  67. # Newtware Specials:  compressed and PC-based files (also zsh, above).
  68. # Greg Roelofs, 15 May 92.  Most recent revisions:  7 Jan 93.
  69. #
  70. 0    string        MZ            MS-DOS executable
  71. >24    string        @            (OS/2 or Windows format)
  72. #
  73. # >>>>> ARC <<<<<
  74. #
  75. 0    string        \032\010        Arc archive
  76. # 0    short        0x1a08            Arc archive
  77. # 0    short        0x081a            Arc archive
  78. #
  79. # >>>>> LHARC/LHA <<<<<
  80. #
  81. 2    string        -lh0-            Lharc 1.x archive
  82. 2    string        -lh1-            Lharc 1.x archive
  83. 2    string        -lz4-            Lharc 1.x archive
  84. 2    string        -lz5-            Lharc 1.x archive
  85. #    [never seen any but the last:]
  86. 2    string        -lzs-            LHa 2.x? archive [lzs]
  87. 2    string        -lh -            LHa 2.x? archive [lh ]
  88. 2    string        -lhd-            LHa 2.x? archive [lhd]
  89. 2    string        -lh2-            Lha 2.x? archive [lh2]
  90. 2    string        -lh3-            LHa 2.x? archive [lh3]
  91. 2    string        -lh4-            LHa 2.x? archive [lh4]
  92. 2    string        -lh5-            LHa (2.x) archive
  93. #
  94. # >>>>> ZIP <<<<<
  95. #
  96. # [newer, smarter "file" programs]
  97. 0    string        PK\003\004        Zip archive
  98. >4    string        \011            (at least v0.9 to extract)
  99. >4    string        \012            (at least v1.0 to extract)
  100. >4    string        \013            (at least v1.1 to extract)
  101. >4    string        \024            (at least v2.0 to extract)
  102. # [stupid "file" programs, big-endian]
  103. # 0    long        0x504b0304        Zip archive
  104. # >1    long        0x4b030409        (at least v0.9 to extract)
  105. # >1    long        0x4b03040a        (at least v1.0 to extract)
  106. # >1    long        0x4b03040b        (at least v1.1 to extract)
  107. # >1    long        0x4b030414        (at least v2.0 to extract)
  108. # [stupid "file" programs, little-endian]
  109. # 0    long        0x04034b50        Zip archive
  110. # >1    long        0x0904034b        (at least v0.9 to extract)
  111. # >1    long        0x0a04034b        (at least v1.0 to extract)
  112. # >1    long        0x0b04034b        (at least v1.1 to extract)
  113. # >1    long        0x1404034b        (at least v2.0 to extract)
  114. #
  115. # >>>>> ZOO <<<<<
  116. #
  117. # [GRR:  don't know if all of these versions exist, or if some missing...]
  118. 0    string        ZOO             Zoo archive
  119. >4    string        1.00            (v%4s)
  120. >4    string        1.10            (v%4s)
  121. >4    string        1.20            (v%4s)
  122. >4    string        1.30            (v%4s)
  123. >4    string        1.40            (v%4s)
  124. >4    string        1.50            (v%4s)
  125. >4    string        1.60            (v%4s)
  126. >4    string        1.70            (v%4s)
  127. >4    string        1.71            (v%4s)
  128. >4    string        2.00            (v%4s)
  129. >4    string        2.01            (v%4s)
  130. >4    string        2.10            (v%4s)
  131. # [newer, smarter "file" programs]
  132. >32    string        \001\000        (modify: v1.0+)
  133. >32    string        \001\004        (modify: v1.4+)
  134. >32    string        \002\000        (modify: v2.0+)
  135. >70    string        \001\000        (extract: v1.0+)
  136. >70    string        \002\001        (extract: v2.1+)
  137. # [stupid "file" programs, big-endian]
  138. # >32    short        0x0100            (modify: v1.0+)
  139. # >32    short        0x0104            (modify: v1.4+)
  140. # >32    short        0x0200            (modify: v2.0+)
  141. # >70    short        0x0100            (extract: v1.0+)
  142. # >70    short        0x0201            (extract: v2.1+)
  143. # [stupid "file" programs, little-endian]
  144. # >32    short        0x0001            (modify: v1.0+)
  145. # >32    short        0x0401            (modify: v1.4+)
  146. # >32    short        0x0002            (modify: v2.0+)
  147. # >70    short        0x0001            (extract: v1.0+)
  148. # >70    short        0x0102            (extract: v2.1+)
  149. # [GRR:  the following are alternate identifiers]
  150. #20    long        0xdca7c4fd        Zoo archive
  151. #20    long        0xc4fddca7        Zoo archive
  152. #
  153. # >>>>> GZIP <<<<<
  154. #
  155. # [newer, smarter "file" programs]
  156. 0    string        \037\213        gzip'd file
  157. # [stupid "file" programs, big-endian]
  158. # 0    short        0x1f8b            gzip'd file
  159. # [stupid "file" programs, little-endian]
  160. # 0    short        0x8b1f            gzip'd file
  161. #
  162. # >>>>> COMPRESS <<<<<
  163. #
  164. # [newer, smarter "file" programs]
  165. # [GRR:  are the upper three bits (block size) ever different from 100?]
  166. 0    string        \037\235        compress'd file
  167. >2    string        \211            (9 bits)
  168. >2    string        \212            (10 bits)
  169. >2    string        \213            (11 bits)
  170. >2    string        \214            (12 bits)
  171. >2    string        \215            (13 bits)
  172. >2    string        \216            (14 bits)
  173. >2    string        \217            (15 bits)
  174. >2    string        \220            (16 bits)
  175. # [stupid "file" programs, big-endian]
  176. # 0    short        0x1f9d            compress'd file
  177. # >1    short        0x9d89            (9 bits)
  178. # >1    short        0x9d8a            (10 bits)
  179. # >1    short        0x9d8b            (11 bits)
  180. # >1    short        0x9d8c            (12 bits)
  181. # >1    short        0x9d8d            (13 bits)
  182. # >1    short        0x9d8e            (14 bits)
  183. # >1    short        0x9d8f            (15 bits)
  184. # >1    short        0x9d90            (16 bits)
  185. # [stupid "file" programs, little-endian]
  186. # 0    short        0x9d1f            compress'd file
  187. # >1    short        0x899d            (9 bits)
  188. # >1    short        0x8a9d            (10 bits)
  189. # >1    short        0x8b9d            (11 bits)
  190. # >1    short        0x8c9d            (12 bits)
  191. # >1    short        0x8d9d            (13 bits)
  192. # >1    short        0x8e9d            (14 bits)
  193. # >1    short        0x8f9d            (15 bits)
  194. # >1    short        0x909d            (16 bits)
  195.  
  196. =============================================================================
  197.  
  198. Date: Sun, 16 May 93 15:56:23 CDT
  199. From: Darrel R Hankerson <hankedr>
  200. To: roe2@midway.uchicago.edu
  201. Cc: darwin@cs.toronto.edu, ian@sq.com, j.adams@ucl.ac.uk
  202. In-Reply-To: "Cave Newt"'s message of Sun, 16 May 93 14:39:15 CDT <9305161939.AA19475@midway.uchicago.edu>
  203. Subject: magic entries for compressors/archivers
  204.  
  205. [[...]]
  206. I have not heard from Mr Darwin for some time. Originally, he
  207. suggested that he may be able to integrate the OS/2 changes into the
  208. main sources. There is one obscure buglet in the OS/2 port (I managed
  209. to change the nature of an existing buglet, rather than fix it--it's
  210. an embarrassing programming mistake on my part...).  There is also the
  211. problem of some bugs in the OS/2 DosQ[uery]Apptype call.
  212.  
  213. =============================================================================
  214.  
  215. Date: Sun, 16 May 93 20:31:20 CDT
  216. From: Darrel R Hankerson <hankedr>
  217. To: roe2@midway.uchicago.edu
  218. In-Reply-To: "Cave Newt"'s message of Sun, 16 May 93 18:21:54 CDT <9305162321.AA26546@midway.uchicago.edu>
  219. Subject:  magic entries for compressors/archivers
  220.  
  221. >> There is one obscure buglet in the OS/2 port (I managed
  222. >> to change the nature of an existing buglet, rather than fix it--it's
  223. >> an embarrassing programming mistake on my part...).  There is also the
  224. >> problem of some bugs in the OS/2 DosQ[uery]Apptype call.  I plan to
  225. >
  226. >   I assume one of these is the "OS/2 executableDOS executable (EXE)"
  227. >   bug--I forgot to mention that.  It occurs on various executables,
  228. >   possibly non-window-compatible ones (though I thought Phoenix was
  229. >   a PM program...).
  230.  
  231. Another silly programming mistake. This occurs if the application type is
  232. not set in the header.  The "obscure buglet" occurs only if using the "-c"
  233. option, and then only with certain bad magicfile entries. The programming
  234. error is elementary (and embarrassing).
  235.  
  236. There are more serious problems with the call. Eberhard Mattes reported
  237. that it identifies the new Windows Emacs exe incorrectly.
  238. As I posted on .apps, there is some strange bug which can be seen 
  239. on my machine with:
  240.   1. copy du.exe .
  241.   2. copy \autoexec.bat .\du.ini
  242.  
  243. Now do "file du.*" or "apptype du.*". The report can change on repeated runs.
  244. A partial solution would be to check for the exe signature.
  245.  
  246. [[OS/2 2.1 may have solved some of the problems. DH 30-Jul-93]]
  247.  
  248. >   Looking forward to the next version--this port was heaven-sent.
  249. >   I had even grabbed some ancient version of it from either the 
  250. >   Berkeley Net2 or 386BSD sources, intending to port it myself.  
  251.  
  252. I had been looking for "file" for some time. I started with a port of
  253. Selke's Pascal "filetype" program. His handling of magicfile entries
  254. is different, but I decided that compatibility with "file" on
  255. magicfile entries was essential. Darwin's code appears to be very
  256. well-done.
  257.  
  258. Additional magicfile entries (INF, .obj, etc.) are needed. The TeX-stuff
  259. does not always work. I don't know if the "compress'd file unwinding"
  260. is all that useful, but gzip-unwinding should be added.  I had planned
  261. to wait for Darwin to release 3.10, but I may try to do a bugfix this week.
  262.  
  263. --Darrel Hankerson hankedr@mail.auburn.edu or hank@ducvax.auburn.edu
  264.  
  265. =============================================================================
  266.  
  267. Date: Mon, 31 May 93 17:37:03 CDT
  268. From: "Cave Newt" <roe2@midway.uchicago.edu>
  269. To: hankedr@mail.auburn.edu
  270. Subject: Re: Unix 'file' cmd?
  271.  
  272. Just a few more OS/2 entries for file/2 3.9b (or whatever :-) ).
  273. I wrote a Unix program to give me lots of information about these
  274. things, but I find that often I only want to know which format
  275. a bitmap is, not the gory details of its size, palette, etc.  I
  276. haven't tested any but the bitmap entries...
  277.  
  278. # >>>>> BMP, etc. <<<<<
  279. #
  280. 0    string        BM            bitmap
  281. >14    byte        12            (OS/2 1.x format)
  282. >14    byte        64            (OS/2 2.x format)
  283. >14    byte        40            (Windows 3.x format)
  284. 0    string        IC            icon
  285. 0    string        PI            pointer
  286. 0    string        CI            color icon
  287. 0    string        CP            color pointer
  288. 0    string        BA            bitmap array
  289.  
  290. Greg
  291.  
  292. P.S.  The >14 entries should really be strings of length four, but
  293.       at least Ultrix file(1) won't let you reference "\000" in
  294.       strings.  The alternative would be longs, but that gets into
  295.       endianness.
  296.  
  297. =============================================================================
  298.  
  299. Date: Mon, 31 May 93 18:16:30 CDT
  300. From: "Cave Newt" <roe2@midway.uchicago.edu>
  301. To: hankedr@mail.auburn.edu
  302. Subject: Re:  Unix 'file' cmd?
  303.  
  304. [[...]]
  305. > Speaking of speed...the magic file should probably be trimmed. Perhaps
  306. > I should include a sed script to strip the comments. (There are many entries
  307. > which could be deleted on OS/2.)
  308.  
  309. Or you might simply include a much-truncated version in addition to
  310. the full one--that way people can add anything from the full version
  311. which they might find useful (for example, VMS .exe's are hard to
  312. distinguish from MS-DOS ones by name alone...).  Perhaps the short
  313. one could just have OS/2-relevant executables/archivers/images?
  314.  
  315. > I've only given a little thought to some of the other problems. I have not
  316. > yet looked into identifying inf files. There is some "ascii magic" code which
  317. > could be modified to identify rexx code, if I could think of some intelligent
  318. > way to do this.
  319.  
  320. Good luck. :-)  Aside from searching for "say" commands and/or the
  321. absence of curly braces, that could be very tricky...
  322.  
  323. =============================================================================
  324.  
  325. Date: Thu, 17 Jun 93 20:23:56 CDT
  326. From: Darrel R Hankerson <hankedr>
  327. To: jon@stekt.oulu.fi
  328. Subject: file-like programs
  329.  
  330. In article <9306171643.FA22240@tacom-emh1.army.mil> jon@stekt.oulu.fi (Jouni Miettunen) writes:
  331. >["file"-like programs; identify files based on contents]
  332.  
  333. Thanks for this summary. I've been working on an OS/2 and MSDOS port
  334. of Darwin's "file" program.  My main interest is OS/2, but there are also
  335. MSDOS versions in the archive:
  336.   ftp.luth.se:pub/os2/all/unix/unixutils/file39.zip
  337.  
  338. This version has some "ascii magic" code and the (fairly) standard unix
  339. "magic" file. Under OS/2, there is additional code to determine the 
  340. application type (DOS, Windows, 32-bit, DLL, WINDOWCOMPAT, etc.).
  341.  
  342. You mention:
  343.  
  344. >Name: FileType
  345. >Version: 1.1
  346. >Date: 19 August 1991
  347. >Description: identify files
  348. >IdType: external magic (about 105)
  349. >Where: garbo:\pc\fileutil simtel:filutl
  350. >Archive: filtyp11.zip (21394k)
  351. >Status: freeware
  352. >Author: Gilbert W. Selke (s00100@dbnrhrz1.bitnet)
  353. >Comments: pascal source included
  354.  
  355. In fact, my first "file" program was a port of Selke's version to C. However,
  356. Selke uses a magic file which is not compatible with the ones found on unix
  357. (it does have some useful ways to make entries), and I believe that 
  358. compatibility with the UNIX magicfile format is essential (note, however,
  359. that the magic-file format is not the same on every machine, but most 
  360. entries I've seen on the net are of the type handled by Darwin's version).
  361.  
  362. If anyone would like to continue work on Selke's version, you are welcomed
  363. to my C version. I was not able to reach Selke on this (no reply), and 
  364. I do think that Darwin's version may be better if you are getting 
  365. magicfile entries from the net.
  366.  
  367. I had planned to announce this port after I fix a silly OS/2 buglet, and
  368. I would like to add more OS/2 (and MSDOS) magicfile entries. Comments
  369. are welcomed. Thanks to Greg Roelofs for the bug reports and contributions
  370. to the magic file.
  371.  
  372. --
  373. --Darrel Hankerson hankedr@mail.auburn.edu or hank@ducvax.auburn.edu
  374.  
  375. =============================================================================
  376.  
  377. Date: Fri, 18 Jun 93 16:48:37 CDT
  378. From: Darrel R Hankerson <hankedr>
  379. To: jon@stekt.oulu.fi
  380. In-Reply-To: Jouni Miettunen's message of Fri, 18 Jun 93 19:21:48 +0300 <9306181621.AA16706@stekt.oulu.fi>
  381. Subject: file-like programs
  382.  
  383. >   Thanx! I'll add this to the list, however I'm not familiar with any
  384. >   Darwin version. Where I could find this? Is this The Original?
  385.  
  386. I don't know if it is "The Original" (the man page suggests that there is
  387. no such thing :), but it appears to be in wide use. From the man page:
  388.  
  389. DESCRIPTION                                                                    
  390.      File tests each argument in an attempt to classify it.  There  are  three 
  391.      sets  of  tests, performed in this order:  filesystem tests, magic number 
  392.      tests, and language tests.  The first test that succeeds causes the  file 
  393.      type to be printed.                                                       
  394.  
  395.  You can obtain the original author's latest version by anonymous  FTP  on 
  396.  ftp.cs.toronto.edu in the directory /pub/darwin/file.                     
  397.  
  398. Darwin's version will also "unwind" compress'd files to examine the contents;
  399. e.g., the compressed file autoexec.bat.Z will show up as 
  400.  [c:\tmp]file -z autoexec.bat.Z                               
  401.  autoexec.bat.Z: ascii text (block compressed data - 16 bits) 
  402.  
  403. The "-z" option tells file to unwind if the file has been compress'd.
  404. I don't know if this feature is really needed, but it is interesting. gzip
  405. capability needs to be added.
  406.  
  407.  
  408. >   Well, my favorite is Ricki's File and it uses a kind of extended unix
  409. >   magicfile format. I collected all different unix magic files I could
  410. >   find (about a half a dozen) and emailed them to him and he said it was
  411. >   still compatible. I believe he still preserved the big/ little indian
  412. >   compatible data format, but someone would have to actually try it in
  413. >   such machines.
  414.  
  415. I briefly examined the magic file, and it appears to have approximately
  416. the same flexibility as Darwin's version. Darwin's version does not have
  417. the "#@" pseudo-comment. The names of some of the data types are slightly
  418. different.
  419.  
  420. > [Selke's FileType]
  421. >   Well, I could make an entry for it and add a note that source is
  422. >   available. Do I put into it that source is available from you or from
  423. >   me? I'd prefer it'd be you, but it's not a big deal. Some ftp place
  424. >   maybe?? Unfortunately I have none.
  425.  
  426. Perhaps with file10 and Darwin's file39, there is no need to bother with 
  427. an update to Selke's version. I could upload a new FileType archive to simtel,
  428. with both the original and the new versions, but I'd like Selke's permission.
  429.  
  430.  
  431. >   Maybe you could let me know, too, when you make that public.. about
  432. >   magic files, well, I did email my collection to Ricki (Richard Breuer)
  433. >   and it's all in there in an external ascii
  434. >   unix-more-or-less-compatible format. No OS/2 as far as I know, and
  435. >   actually I do know. Maybe you could send them to me and I could send
  436. >   you the whole unix collection :-) I'll forward them to Ricki. Let me
  437. >   know and I'll try to find them.
  438.  
  439. I will be examining the file10 magic file when I do the update to Darwin's
  440. version (I need to fix a small OS/2 buglet). Darwin's collection may be of
  441. interest to you. We should try to compare your unix collection with Darwin's.
  442. My port on ftp.luth.se is "public"; I did not announce earlier since I wanted
  443. to wait for any bug reports. 
  444.  
  445.  
  446. >   My version is entirely based on DOS and DOS filenameextensions.
  447. >   Almost 2000 entries now.. should fix the #$&# redblack library.
  448.  
  449. In the OS/2 and MSDOS world, a combination of your method
  450. and the "file" method could be more effective than just a "file" approach.
  451. Darwin's version does have some "ascii magic" which tries to identify stuff
  452. like fortran source code by looking through the first part of the file for
  453. certain keywords. 
  454.  
  455. Thanks again for your summary. I did not know of some of the versions 
  456. mentioned.
  457.  
  458. --Darrel Hankerson hankedr@mail.auburn.edu
  459.  
  460. =============================================================================
  461.  
  462. Date: Sat, 19 Jun 93 20:35:37 +0300
  463. From: Jouni Miettunen <jon@stekt.oulu.fi>
  464. To: hankedr@mail.auburn.edu
  465. In-Reply-To: <9306182148.AA16798@ducserv.duc.auburn.edu> (message from Darrel R Hankerson on Fri, 18 Jun 93 16:48:37 CDT)
  466. Subject: Re: file-like programs
  467.  
  468. [[...]]
  469. However file39.zip agreed to unpack itself. Most Impressive! I took
  470. just a small preview into all the files, but I noticed that you are
  471. more serious about this than I am. I'll pack the magic and email it on
  472. Monday.. I noticed file 3.9/10 is part of Linux and BSD (?), but
  473. how about GNU? Are they interested?
  474.  
  475. >The "-z" option tells file to unwind if the file has been compress'd.
  476. >I don't know if this feature is really needed, but it is interesting. gzip
  477. >capability needs to be added.
  478.  
  479. Well, IMO it's same as unarchiving a .zip file and identifying its
  480. contents. An interesting idea considering the dozens of different
  481. archivers, but might be a bit too far from the original purpose.
  482.  
  483. >I briefly examined the magic file, and it appears to have approximately
  484. >the same flexibility as Darwin's version. Darwin's version does not have
  485. >the "#@" pseudo-comment. The names of some of the data types are slightly
  486. >different.
  487.  
  488. There were a couple nice additions to the normal unix format. First
  489. the keyword, with which you could check only text, graphics
  490. etc. related magic and then a pointer-like operator, which could
  491. either check or copy on-screen the following bytes. This was because
  492. of self-extracting archivers and their all too many identification
  493. strings. Maybe you could contact Ricki and try to create a more common
  494. and portable magic file format.. Last time I heard about him, he was
  495. quite busy with his new job, but seems to check email every now and
  496. then.
  497.  
  498. >> [Selke's FileType]
  499. >Perhaps with file10 and Darwin's file39, there is no need to bother with 
  500. >an update to Selke's version. I could upload a new FileType archive to simtel,
  501. >with both the original and the new versions, but I'd like Selke's permission.
  502.  
  503. Well, it wouldn't be the first update made by others than original
  504. author. As-is Selke's FileType is outdated and if you do have a better
  505. version ready and if you include info about the history of that
  506. program, then I think you should upload it. It seems like Selke is not
  507. connected to net anymore. With a new version you'd keep his memory and
  508. work alive :) I would like that, but unfortunately I haven't released
  509. any source to net.
  510.  
  511. >I will be examining the file10 magic file when I do the update to Darwin's
  512. >version (I need to fix a small OS/2 buglet). Darwin's collection may be of
  513. >interest to you. We should try to compare your unix collection with Darwin's.
  514. >My port on ftp.luth.se is "public"; I did not announce earlier since I wanted
  515. >to wait for any bug reports. 
  516.  
  517. [[...]]
  518.  
  519. >>   My version is entirely based on DOS and DOS filenameextensions.
  520. >>   Almost 2000 entries now.. should fix the #$&# redblack library.
  521. >
  522. >In the OS/2 and MSDOS world, a combination of your method
  523. >and the "file" method could be more effective than just a "file" approach.
  524.  
  525. Yes, that's the reason I originally dumped everything to Ricki. He
  526. already had a better program I could hope to make and desided to
  527. concentrate into the other version. Besided there really wasn't enough
  528. magic around to make the program useful. Ricki made a good job. IMHO.
  529.  
  530. >Darwin's version does have some "ascii magic" which tries to identify stuff
  531. >like fortran source code by looking through the first part of the file for
  532. >certain keywords. 
  533.  
  534. This is what the What program does for text files. I once checked a
  535. couple books about various text file formats. Not enough to make a
  536. useful program and there already was a very good tool available.
  537.  
  538. --jouni
  539.  
  540. ============================================================================
  541.  
  542. Date: Tue, 22 Jun 93 20:02:04 +0300
  543. From: Jouni Miettunen <jon@stekt.oulu.fi>
  544. To: hankedr@mail.auburn.edu
  545. Subject: about magic collection + new AIX370 + comments
  546.  
  547. I just sent all magic files I had and at the end of this I'll enclose
  548. a new version from AIX370. Alliant (Concentrix 5.7.00) didn't seem to
  549. have any external magic file and when I checked the executable itself,
  550. it indeed had build-in data, including the ascii magic as in file39.
  551. I'll check if VM/XA has any file utility, too, but I believe I won't
  552. be able to locate it. I never could get hold of that 2-level deep
  553. directory structure..
  554.  
  555. The magic collection has lots of redundant data, but since I prefer
  556. checking original documents, I sent them as-is.. including the various
  557. copyright notices, which you can't find in the news articles. I hope
  558. these won't cause any trouble. I'm not even sure, if such magic number
  559. information can be copyrighted at all..
  560.  
  561. The Ascii Magic (AM), which I first saw in file39's code and then in
  562. Alliant file's code, is a great idea. I was thinking about adding such
  563. thing into filex as a next improvement (filex is my file extension
  564. idenfier) and after that a thing I call Environmental Magic (EM)..
  565.  
  566. When you have tried all the conventional ways eg. looking for magic
  567. numbers, trying file extension and with text files scanning the
  568. contents (AM) and still haven't been able to identify it, you could
  569. try checking the environment of file:
  570. - what type are the other files same directory
  571. . unknown is probably same/same as majority (if such is clear)
  572. - what is the name of the directory/path
  573. . some keywords there? Doc - music - pict
  574. - what executables are in the directory
  575. . data files usually belong to executable in same file
  576.  
  577. Only the identification of the other files in same directory seem to
  578. be useful operation, eg. a couple is identified as printer drivers by
  579. magic numbers and the rest have a same file extension, then all are
  580. propably printer drivers. If the absolute path includes keyword "win"
  581. they are propably printer drivers for Windows.. Better than
  582. "Unknown file"..
  583.  
  584. The Ascii Magic part should be enhanced to be useful in OS/2 and DOS
  585. environments. First there are too few of them (too many slow the
  586. overall operation, on the other hand I believe AM is the last change
  587. anyway, not a supporting identification way) and secondly they really
  588. are too Unix orientated. Eg. I doubt one could find any assembly text
  589. (looks like Motorola 68000, but I really don't know. Except it isn't
  590. for 80x86 processor) and it should be changed to identify something
  591. that really could exist, in this case TASM or MASM compatible assembly
  592. for the used processor. Also shell script should be changed to DOS
  593. batch files and also add OS/2 .cmd files and REXX code. The
  594. programming languages should be changed to.. (what was there? Fortran,
  595. APL and C?)  C/C++, Pascal etc.
  596.  
  597. Even though it's good that you ported Darwin's file to OS/2, it's not
  598. enough, since it's way too much Unix orientated. Just take a look at
  599. magic files, full of various Unix executables, shells (btw bash
  600. (Bourne Again SHell) was missing), etc., totally useless data for these
  601. operating systems.. and it's missing something that would be
  602. valuable for OS/2 and DOS:
  603. - executables
  604. . Windows, OS/2, 32-bit, maybe even GEOS etc. executables
  605. . compressed executables (about half a dozen different)
  606. . self-extracting file archives
  607.   a dozen or two different archivers, each have a few diff. versions
  608. - graphics files
  609. . a couple dozen different formats, pretty well covered
  610. - text formats
  611. . a couple dozen different, another useful class
  612. . I know two old books, don't cover any modern text processors
  613. - file archivers
  614. . almost all covered
  615. . the 4 most usual Mac archivers should be added
  616.  
  617. Now I see only two ways: either you branch file39 to a separate file
  618. remotely connected to Darwin's file or try to make changes to that
  619. original one.
  620.  
  621. Well, this was some of my opinions about file39. It's a good unix util
  622. port, but could use some changes or additions to make it support more
  623. target OS, to be even more useful. Enhancing the Ascii Magic part
  624. would give most with least work.
  625.  
  626. --jouni
  627.  
  628. =============================================================================
  629.  
  630. Some misc info I collected.. first offset from the beginning of the file
  631. and then either a character or a hex number inside parenthesis. Only the
  632. self-extracting archive stuff is interesting,
  633.  
  634. --jouni
  635.  
  636. zip (4 chars):
  637. 0:PK(03)(04)
  638.  
  639. lzh (5 chars, 3rd tells compression type 1-5):
  640. 3:-lh(??)-
  641.  
  642. zoo (text string):
  643. 0:ZOO 2.00 Archive
  644. 0:ZOO 2.10 Archive
  645.  
  646. arc:
  647. 0:(01)(08)
  648.  
  649. lharc self-extracting package:
  650. 24:LHA's SFX 2.12S (c) Yoshi, 1991    (.exe file)
  651. 24:LHA's SFX 2.13L (c) Yoshi, 1991    (.exe file)
  652. 6:SFX of LHarc 1.00 (c)Yoshi, 1989    (.com file)
  653.  
  654. zip self-extracting package:
  655. 1e:Copyright 1989-1990 PKWARE Inc. All Rights Reserved.
  656.  
  657. arj self-extracting package:
  658. 1c:RJSX(ff)(ff)
  659.  
  660. lzexe compressed executable:
  661. 19:(00)(00)(00)LZ91
  662.  
  663. pklite compressed executable -offset 1e = .exe -offset 2e/30 = .com:
  664. 1e:PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reserved(07)(00)(00)(00)
  665.  
  666. diet compressed executable:
  667. 1c:diet(f9)(9c)
  668.  
  669. Microsoft executable:
  670. 0:MZ
  671.  
  672. Norton Guides database:
  673. 0:NG(00)(01)(00)(00)(xx)(00)
  674. 8 to 2f info header
  675. 30 to 179 long info
  676.  
  677. HPACK file archive:
  678. 0:HPAK
  679.  
  680. =============================================================================
  681.  
  682. From: ddissett@netcom.com (Daniel Dissett)
  683. Subject: Re: Fetch Title of an .INF
  684.  
  685. The title of an .INF file is located 108 bytes into the file and can be
  686. up to 64 bytes long. The title is null terminated. I use the following
  687. REXX procedure to strip the title out of .INF files:
  688.  
  689.    GetInfTitle:
  690.    procedure
  691.        parse arg infFile
  692.        data = charin( infFile, 108, 64 )
  693.        call stream infFile, 'c', 'close'
  694.        if data = '' then return ''
  695.        title = left( data, pos( d2c( 0 ), data ) - 1 )
  696.        return title
  697.  
  698. [[...]]
  699. I did some quick checking and the ten or so .INF files I looked at
  700. start with the following sequence:
  701.  
  702.    48 53 50 01  9b 00 02 00
  703.  
  704. [[See inf02a.doc]]
  705.  
  706. =============================================================================
  707.  
  708. Date: Sun, 1 Aug 93 10:27:59 CDT
  709. From: Darrel R Hankerson <hankedr>
  710. To: marcusg@ph-cip.uni-koeln.de, chauser.parc@xerox.com
  711. Subject: inf02a.doc
  712.  
  713. Thanks for inf01 and inf02! This arrived just in time for an update to
  714. the "file" program. I see that you have 
  715.  int16 ID;           // ID magic word (5348h = "HS")
  716.  int8  unknown1;     // unknown purpose, could be third letter of ID
  717.  int8  flags;        // probably a flag word...
  718.                     //  bit 0: set if INF style file
  719.                     //  bit 4: set if HLP style file
  720.  
  721. According to limited testing by three people, INF files start with
  722.    HSP\x01\x9b\x00 
  723. and HLP files start with
  724.    HSP\x10\x9b\x00
  725.  
  726. Of course, this agrees with the "bit 0, bit 4" and other info in your docs.
  727. I'm using the above as magic-file entries, hoping that it (almost) 
  728. positively identifies the files (I'm hoping it works and is better than
  729. just checking "HS").
  730.  
  731. =============================================================================
  732.  
  733. Date: Fri, 30 Jul 93 16:01:45 CDT
  734. From: "Cave Newt" <roe2@midway.uchicago.edu>
  735. To: hankedr@mail.auburn.edu
  736. Subject: Re:  file 3.9a
  737.  
  738. [[...]]
  739. > 1. You have "0 ZOO ..." for zoo archives, with alternate choice
  740. > at offset 20. I was planning to continue to use your stuff listed at
  741. > offset 20, but I find that it is really at 0x2a. (I need to check if this
  742. > is DOS/OS2-specific.)
  743.  
  744. Oops...you're quite correct.  I probably got my hex/dec conversion
  745. mixed up or something (0x20+10?).  I've never used that identifier
  746. myself; I think I found it in the source code somewhere.
  747.  
  748.  
  749. > If you have any "unusual" inf files, perhaps you could test this. I've
  750. > tested everyting on my 2.1 machine and prcp.inf, guiref.inf, the
  751. > posted GNU texi-to-os2inf files, and saaref.inf. The inf01.doc
  752. > lists these bytes as unknown.
  753.  
  754. Works OK on the following (which was all I could find):
  755.  
  756. 4os2.inf:     OS/2 INF (4OS2 1.11 Online Documentation)
  757. CMDREF.INF:   OS/2 INF (OS/2 Command Reference)
  758. COMMON.INF:   OS/2 INF (Common/2 Subroutine Library version 1.0.1)
  759. EDMI1.INF:    OS/2 INF (EDM/2 - Issue #1 - March 1993)
  760. emxfn.inf:    OS/2 INF (EMX Library)
  761. GG243730.INF: OS/2 INF (OS/2 V2.0 Volume 1: Control Program)
  762. GG243731.INF: OS/2 INF (OS/2 V2.0 Volume 2: DOS and Windows Environment)
  763. GG243732.INF: OS/2 INF (OS/2 V2.0 Volume 3: PM and Workplace Shell)
  764. GG243774.INF: OS/2 INF (OS/2 V2.0 Volume 4: Application Development)
  765. OS2TNT.INF:   OS/2 INF (Tips and Techniques)
  766. REXX.INF:     OS/2 INF (OS/2 Procedures Language 2/REXX)
  767. GUIREF20.INF: OS/2 INF (Control Program Reference)
  768. IPFC20.INF:   OS/2 INF (Information Presentation Facility)
  769. IPFCEXMP.INF: OS/2 INF (Compiled Examples)
  770. PMFUN.INF:    OS/2 INF (PM Reference)
  771. PMGPI.INF:    OS/2 INF
  772. PMHOK.INF:    OS/2 INF
  773. PMMSG.INF:    OS/2 INF
  774. PMREL.INF:    OS/2 INF
  775. PMWIN.INF:    OS/2 INF
  776. PMWKP.INF:    OS/2 INF
  777. prcp.inf:     OS/2 INF (OS/2 Programming Reference)
  778. REXXAPI.INF:  OS/2 INF (REXX Program Reference)
  779. SOM.INF:      OS/2 INF (System Object Model (SOM) Reference)
  780. TOOLINFO.INF: OS/2 INF (Tools Reference)
  781. DDE3WF.INF:   OS/2 INF (IBM WorkFrame/2* Online Reference)
  782. DDE4HELP.INF: OS/2 INF (IBM C Set/2 Online Reference)
  783.  
  784. =============================================================================
  785.  
  786. Date: Sun, 1 Aug 93 12:52:42 CDT
  787. From: Darrel R Hankerson <hankedr>
  788. To: roe2@midway.uchicago.edu
  789. Subject: file 3.9a
  790.  
  791. I do not have many interesting files either. Much more work is needed
  792. on the magic-file. Some magic entries match on too-limited
  793. information.  The "tentative-match" idea might help. The addition of
  794. regular-expressions in the string may be a good idea for the next
  795. version. Also, it might be nice to be able to make better use of those
  796. text fields which are preceded by a length byte/int.
  797.  
  798.  
  799.    Note that both PKZIP and LH2 are capable of making self-extracting
  800.    executables under OS/2.  Also, it just occurred to me that checking
  801.    the magic file is unlikely to be helpful, because the signatures are
  802.    buried in the middle of the executable.  (Certainly the ZIP magic 
  803.    entries will fail--they check the first four bytes.)  I think it
  804.    really needs some sort of smart checking (perhaps figuring out where
  805.    the executable's data segment begins and looking at that?).  Probably
  806.    not so easy...
  807.  
  808. I placed some additional entries in Magdir/ms-dos for these. However,
  809. the current OS/2 beta only checks the magic-file if DosQueryAppType
  810. fails or indicates DOS. In addition, the check for PKSFX is from
  811. 1.01; I do not know how to check the version used on
  812. ftp-os2.cdrom.com:pub/os2/all/archiver/unz50x16.exe
  813.  
  814. This is one of those things that I haven't decided how to
  815. handle. There are arguments for always doing both the AppType-call and
  816. the magic-check.  I wanted to minimize the number of switches, and
  817. keep the output clean on executables. On the other hand,
  818. DosQueryAppType is not without its problems.
  819.  
  820.  
  821. On the magic-file: I see that some of your zoo entries are of form 
  822.  >4    string          1.00                    (v%4s)
  823.  
  824. Apparently, your mean to write "(v%.4s)". In any case, I've used
  825.  0x2a    string   \xdc\xa7\xc4\xfd
  826.  >0 string         >0          %.16s
  827.  
  828. for zoo files.  Perhaps you can scan the magic-file entries which you
  829. have contributed, and see if I have these correct (both in form and
  830. credits).
  831.  
  832. =============================================================================
  833.  
  834. Date: Sun, 1 Aug 93 17:03:02 CDT
  835. From: Darrel R Hankerson <hankedr>
  836. To: jon@stekt.oulu.fi
  837. In-Reply-To: <9307301022.AA06564@stekt.oulu.fi> (message from Jouni Miettunen on Fri, 30 Jul 93 13:22:15 +0300)
  838. Subject: Re: new versions of programs
  839.  
  840. [[...]]
  841.    And while we are talking about mysterios errors, I experienced some
  842.    w/file39:
  843.  
  844.    Eg. in garbo.uwasa.fi:/pc/arcers you can find unz50p1.exe and
  845.    zoo210.exe, which are self-extracting file archivers. Your file
  846.    identifies them as "Linux/i386 not stripped".
  847.  
  848. The magic-file needs more work. Currently, the file "magic" is created
  849. by cat'ing, in alphabetical order, all the stuff in ./Magdir/. This
  850. means that the "linux" stuff comes before the "ms-dos" stuff. (The OS/2
  851. version uses a DosQueryApptype call.)
  852.  
  853.  
  854.    Another weird problem I found w/Tristan (a flipper game) configuration
  855.    file.. it's a plain ASCII file:
  856.    Video = 1
  857.  
  858. Again, this shows problems with the magic-file. Someone has used a
  859. 1-byte check 
  860.    0       byte    0126    ps database
  861. which is probably a bad idea.
  862.  
  863.  
  864.    OS/2 info and I was wondering, if you would know this.. what are the
  865.    magic numbers for OS/2 executables in the New EXE Header (offset 0ch)?
  866.  
  867. At the end of this note is the new ms-dos (and OS/2) exe-magic entries
  868. that I've been testing (a number of these are from you). Roelofs gives
  869. the one for OS/2 and Windows exe. Note that under OS/2, the
  870. DosQueryAppType call is used.
  871.  
  872. I'm planning to upload the bugfixes soon. I was hoping to hear from
  873. Darwin on 3.10.  You mentioned a number of good ideas in earlier notes.
  874. From your notes and the work on this port, I see the following as possible
  875. future enhancements to file:
  876.  1. regular expressions in the string
  877.  2. the "pseudo-comment" idea and the keyword idea
  878.  3. "tentative match" requiring a match in some following line
  879.  4. additions from the filex approach
  880.  5. capability to use, for example, the length-byte which precedes
  881.     a string.
  882.  
  883. [[...]]
  884. One last thing: I plan to include edited versions of some of your
  885. notes and suggestions, provided that you have no objections. I can
  886. forward a copy if you wish to review.
  887.  
  888. =============================================================================
  889.  
  890. Date: Tue, 3 Aug 93 16:51:34 +0300
  891. From: Jouni Miettunen <jon@stekt.oulu.fi>
  892. To: hankedr@mail.auburn.edu
  893. In-Reply-To: <9308012203.AA27657@ducserv.duc.auburn.edu> (message from Darrel R Hankerson on Sun, 1 Aug 93 17:03:02 CDT)
  894. Subject: Re: new versions of programs
  895.  
  896. [[...]]
  897. >The magic-file needs more work. Currently, the file "magic" is created
  898. >by cat'ing, in alphabetical order, all the stuff in ./Magdir/. This
  899. ...
  900. >Again, this shows problems with the magic-file. Someone has used a
  901.  
  902. Have you read the latest (it's July, the graphics magazine) Dr. Dobb's
  903. Journal? There is an interesting article about fuzzy logic by Abrasm
  904. (sp) and it seems to express more clearly, what I had in my mind.
  905.  
  906. In case of magic numbers one should check _all_ magic. If there's only
  907. one identification, that'll be shown. If there are more, one has to
  908. recheck all found identifications in another way, eg. if one is for
  909. unix and another for dos, then we'll check the used operating system
  910. and show the one labeled to that OS, since it'll be much more likely
  911. the correct one. The used OS can be hardcoded while compiling the
  912. program. Besides using labels in magic file (Ricki's idea), in dos and
  913. OS/2 one can check the filename extension, in which case extensions
  914. and magic numbers should be connected somehow. The idea behind File is
  915. that files can have "wrong" name and so extensions could be used only
  916. to select one from a couple possible id's. A major problem w/Filex..
  917.  
  918. W/Tristan file there'd be Linux and ASCII identification and since OS
  919. was DOS, the ASCII would have been the correct id. BTW there's same
  920. kind of trouble w/device drivers in \dos directory.. One reason to
  921. write Filex was to get quantity. I'll rather see even false id's than
  922. almost all files as unidentified. With File39 you have critical mass,
  923. too, to get people to use it, but now you need quality eg. correct
  924. identifications and so do I. Here we go Fuzzy :) Too bad I haven't
  925. found any books about this, it seems this could use some nice data
  926. structure..
  927.  
  928. Another way to deside wanted identification is to use some preknown
  929. keywords in the output strings, that's what I'll do w/filex. To find
  930. out the keyword one could use 1) directory name (dbase, graphics) 2)
  931. part of path (windows) 3) external configuration file (bc3 - Borland
  932. C++ 3.1) 4) one given on command line.
  933.  
  934.  
  935. [[...]]
  936. > 4. additions from the filex approach
  937.  
  938. Only if one can combine magic and extensions. You got 900 magic
  939. numbers and I got 1500 extensions :) And the file can always have a
  940. wrong extension..
  941.  
  942. [[...]]
  943. Old EXE header can be identified by MZ (or ZM) as the first chars of
  944. file. If some offset has value 0x40 or more (the size of header?),
  945. then there is a new EXE header starting from place mentioned in some
  946. other offset, this might be the second line above.. The new EXE header
  947. starts with chars NE (as in New Executable. MZ was initials of the
  948. designer programmer) and there in some offset is the id byte. Value
  949. 0x2 is for Windows exe, MS Windows SDK manuals said only that values
  950. 1, 3 and 4 are "reserved", so one might be for OS/2, but which one?
  951.  
  952. In another offset there's mentioned the needed Windows version number,
  953. if program indeed is a win app.
  954.  
  955. =============================================================================
  956.  
  957. Date: Tue, 3 Aug 93 11:01:00 CDT
  958. From: Darrel R Hankerson <hankedr>
  959. To: roe2@midway.uchicago.edu
  960. Subject: notes on file39a
  961.  
  962. In summary, I think extensions to the magic-file entries are needed
  963. (some ideas appear in the notes). I'm hoping that Darwin decides
  964. to coordinate a new version. I'd like to add
  965.   * match on first line only if some ">" line matches
  966.   * "confidence" pseudo-comment, indicating the chances that 
  967.     a match does imply the type of file. A switch could then
  968.     indicate what level of confidence is desired.
  969.   * ability to use, for example, a length-byte which precedes a string
  970.   * regular expressions
  971.   * a new format ("%S" ?) which indicates "print while isprint()"
  972.  
  973. I plan to upload 3.9a. This has been an interesting project, but
  974. I doubt that I will do 3.10 on my own. 
  975.  
  976. =============================================================================
  977.  
  978. Date: Wed, 4 Aug 93 14:30:11 CDT
  979. From: "Cave Newt" <roe2@midway.uchicago.edu>
  980. To: hankedr@mail.auburn.edu
  981. Subject: Re:  notes on file39a
  982.  
  983. > I am considering including some of your email notes in the dist
  984. > of file39a.zip. These would be useful to someone who decides to
  985. > do an enhancement to the program. I include a copy. I would need
  986. > your permission for this.
  987.  
  988. Your second message about them came just as I was reading through
  989. them.  You certainly have my permission, and I even think it would
  990. be interesting to include them--they contain pointers to other ports,
  991. questions about possible errors, etc.  I would go ahead with your
  992. original plan.
  993.  
  994. Btw, the notes say something about the copy du.exe problem being
  995. fixed in 2.1; I'm still running 2.0(+SP), and everything works for
  996. me now, too.  Recompiling must have helped somehow (or maybe there
  997. was a pointer bug in the wildcard/readdir code?).
  998.  
  999. >   * regular expressions
  1000.  
  1001. Ooo, most especially this one.  (All of your ideas were good, but
  1002. this is the one I've most missed, along with indirect offsets.)
  1003.  
  1004. > Did you find any problems with the beta that I sent?
  1005.  
  1006. A few oddities, but mostly problems you already know about, I think.
  1007. Here's a list:
  1008.  
  1009. > pbrush.ico:     bitmap array
  1010.  
  1011. I have no idea why icon files are given the type "bitmap array"
  1012. (by IBM, I mean), but I double-checked for myself--that's the
  1013. correct ID.
  1014.  
  1015. > desktop.cmd:       ascii text
  1016. > nmack.bat:    English text
  1017.  
  1018. As you noted, the ascii magic needs some work.  In these cases
  1019. very short batch files), it would be difficult to make a positive
  1020. ID, but ascii magic might check the file extension under OS/2 and
  1021. MS-DOS (or VMS, for that matter).
  1022.  
  1023. > spin.pmg:          c program text
  1024. > test.pmg:          c program text
  1025.  
  1026. These are actually weird data files, but it would be hard to check
  1027. that.
  1028.  
  1029. > cpumeter.exe:   PM executable [WINDOWAPI]
  1030.  
  1031. Would it be better to label these as 16-bit PM exe's?  Or possibly
  1032. even 16-bit OS/2 PM exe's?  "PM" might not mean a lot to clueless
  1033. MS-DOS types...
  1034.  
  1035. > diskmap.exe:    OS/2 executable
  1036.  
  1037. Ditto (16-bit OS/2 exe?)
  1038.  
  1039. > esctilde.dcp:   data
  1040.  
  1041. I'm sure code pages must have some identifying feature...
  1042.  
  1043. > phoenix.exe:    OS/2 executable
  1044.  
  1045. This is actually a PM program--I don't understand why it doesn't 
  1046. show up as such.
  1047.  
  1048. > pushd.cmd:      c program text
  1049.  
  1050. A REXX script--another ascii magic problem which you've already
  1051. mentioned.
  1052.  
  1053. > pbrush.hlp:     data
  1054. > wizunzip.hlp: data
  1055.  
  1056. These are both Windows-format HLP files.
  1057.  
  1058. > syscols.ini:    ispell hash file and 20 string characters
  1059. > Mine.INI:   ispell hash file and 20 string characters
  1060. > klondike.ini:     ispell hash file and 20 string characters
  1061. > neko.ini:         ispell hash file and 20 string characters
  1062.  
  1063. More ascii magic work needed...
  1064.  
  1065. > wizunzip.wav: data
  1066. > boom1a.snd:   data
  1067.  
  1068. I think these are standard sound formats; I even seem to recall
  1069. seeing some magic entries posted a while back, but I don't know 
  1070. if I saved them.
  1071.  
  1072. > menu.ini:     DOS executable, magic(4)-> ascii text
  1073.  
  1074. Oops...(goes with a DOS executable, though).
  1075.  
  1076. > p1.pal:       ascii text (with escape sequences)
  1077. > power.pal:    ascii text (with escape sequences)
  1078.  
  1079. Some sort of palette file for a DOS game, I think (not a standard,
  1080. but interesting to see what file comes up with).
  1081.  
  1082. > tetris.scr: 8086 relocatable (Microsoft)
  1083. > TrashMan.SCO: VAX-order2 68k Blit mpx/mux executable
  1084.  
  1085. Score files don't seem to fare too well with magic.
  1086.  
  1087. > WOLF3D.EXE:   DOS executable, magic(4)-> DOS executable (lzexe compressed)
  1088.  
  1089. Impressive.
  1090.  
  1091. > DDE4MODL.DLL: DLL
  1092. > DDE4NBS.DLL:  32-bit DLL
  1093. > DDE4RESS.DLL: DLL
  1094. > DDE4SBM.DLL:  32-bit DLL
  1095.  
  1096. I'm surprised that these aren't all 32-bit, but assuming the ID
  1097. is correct, I'd make the same comment as above:  insert "16-bit"
  1098. first?
  1099.  
  1100. =============================================================================
  1101.  
  1102. Date: Wed, 4 Aug 93 21:23:35 CDT
  1103. From: Darrel R Hankerson <hankedr>
  1104. To: roe2@midway.uchicago.edu
  1105. In-Reply-To: <9308041930.AA09245@midway.uchicago.edu> (roe2@midway.uchicago.edu)
  1106. Subject: Re:  notes on file39a
  1107.  
  1108.    Btw, the notes say something about the copy du.exe problem being
  1109.    fixed in 2.1; I'm still running 2.0(+SP), and everything works for
  1110.    me now, too.  Recompiling must have helped somehow (or maybe there
  1111.    was a pointer bug in the wildcard/readdir code?).
  1112.  
  1113. I think it is a bug in 2.0. I can not repeat the bug in 2.1, and your
  1114. note below about "menu.ini" indicates that you still see the bug.
  1115.  
  1116.  
  1117.    very short batch files), it would be difficult to make a positive
  1118.    ID, but ascii magic might check the file extension under OS/2 and
  1119.    MS-DOS (or VMS, for that matter).
  1120.  
  1121. This is one of the additions that Jouni Miettunen suggests. Some 
  1122. combination of "isascii" and the file-extension might be ok. 
  1123. Sometimes the input will be from a pipe, however.
  1124.  
  1125.  
  1126.    > cpumeter.exe:   PM executable [WINDOWAPI]
  1127.    Would it be better to label these as 16-bit PM exe's?  Or possibly
  1128.    even 16-bit OS/2 PM exe's?  "PM" might not mean a lot to clueless
  1129.    MS-DOS types...
  1130.    > diskmap.exe:    OS/2 executable
  1131.    Ditto (16-bit OS/2 exe?)
  1132.  
  1133.  
  1134. The idea (basically from Mattes' apptype) is to use DosQueryApptype to
  1135. report on the file. I simply print messages corresponding to the
  1136. flag-bits. However, this call has some problems (it cannot properly
  1137. identify all executables). In addition, there is no "16-bit" flag,
  1138. and it may be fine to assume 16-bit (I wish I knew...).
  1139.  
  1140. This call is only done on the OS/2 exe, so perhaps the "PM" message 
  1141. is ok.
  1142.  
  1143.  
  1144.  
  1145.    > phoenix.exe:    OS/2 executable
  1146.  
  1147.    This is actually a PM program--I don't understand why it doesn't 
  1148.    show up as such.
  1149.  
  1150. The flag is not set in the header (try markexe).
  1151.  
  1152.  
  1153.    > pbrush.hlp:     data
  1154.    > wizunzip.hlp: data
  1155.  
  1156.    These are both Windows-format HLP files.
  1157.  
  1158. I've made a guess on Windows HLP files. Know any good info on this?
  1159.  0  string   ?_\3\0            Windows HLP
  1160.  
  1161.  
  1162.    > syscols.ini:    ispell hash file and 20 string characters
  1163.    > Mine.INI:   ispell hash file and 20 string characters
  1164.    > klondike.ini:     ispell hash file and 20 string characters
  1165.    > neko.ini:         ispell hash file and 20 string characters
  1166.  
  1167. [[fixed both ispell and INI]]
  1168.  
  1169.  
  1170.    > wizunzip.wav: data
  1171.    > boom1a.snd:   data
  1172.    I think these are standard sound formats; I even seem to recall
  1173.    seeing some magic entries posted a while back, but I don't know 
  1174.    if I saved them.
  1175.  
  1176. I've made some guesses:
  1177.  0  string      RIFF
  1178.  >8 string      AVI      movie
  1179.  >8 string      WAVE     sound
  1180.  0  string      MThd\0   MIDI sound
  1181.  
  1182.  
  1183.  
  1184.    > menu.ini:     DOS executable, magic(4)-> ascii text
  1185.    Oops...(goes with a DOS executable, though).
  1186.  
  1187. I think this illustrates the DosQueryAppType bug under 2.0.
  1188.  
  1189.  
  1190.    > DDE4MODL.DLL: DLL
  1191.    > DDE4NBS.DLL:  32-bit DLL
  1192.    > DDE4RESS.DLL: DLL
  1193.    > DDE4SBM.DLL:  32-bit DLL
  1194.  
  1195.    I'm surprised that these aren't all 32-bit, but assuming the ID
  1196.    is correct, I'd make the same comment as above:  insert "16-bit"
  1197.    first?
  1198.  
  1199. I suppose these could have the corresponding problem to that 
  1200. illustrated by phoenix.exe. Since I'm not certain about this, I think
  1201. I'll leave the code as-is (just report which bits are set). You 
  1202. are probably correct on the 16-bit thing.
  1203.  
  1204. =============================================================================
  1205.  
  1206. Date: Thu, 5 Aug 93 08:27:51 CDT
  1207. From: Darrel R Hankerson <hankedr>
  1208. To: roe2@midway.uchicago.edu
  1209. In-Reply-To: <9308041930.AA09245@midway.uchicago.edu> (roe2@midway.uchicago.edu)
  1210. Subject: Re:  notes on file39a
  1211.  
  1212. Just a few more notes...
  1213.  
  1214.    this is the one I've most missed [reg exp], along with indirect offsets.)
  1215.  
  1216. There is some indirect-offset capability discussed in magic(4). I agree
  1217. on the reg exp. If I recall correctly, Darwin did mention the idea (but
  1218. this was long ago, and I don't see any such note in notes.os2).
  1219.  
  1220.  
  1221.    > cpumeter.exe:   PM executable [WINDOWAPI]
  1222.    Would it be better to label these as 16-bit PM exe's?  Or possibly
  1223.    even 16-bit OS/2 PM exe's?  "PM" might not mean a lot to clueless
  1224.    MS-DOS types...
  1225.  
  1226. I've thought a little more on this. The msg "PM executable" implies 
  1227. "WINDOWAPI", so this is redundant (but perhaps it is consistent with
  1228. the other types). 
  1229.  
  1230.  
  1231.    > syscols.ini:    ispell hash file and 20 string characters
  1232.  
  1233. I see that someone had hacked the ispell entry (must have caused
  1234. problems on some system). I think I've fixed this (for both ispell
  1235. and INI).
  1236.  
  1237.  
  1238.    > boom1a.snd:   data
  1239.  
  1240. I'm not familiar with this one. I do see 
  1241.  0       string          .snd            audio data:
  1242.  >12     long            1               8-bit u-law,
  1243.  >12     long            2               8-bit linear PCM,
  1244.  ...
  1245.  
  1246. ============================================================================
  1247.  
  1248. Date: Thu, 5 Aug 93 10:13:53 CDT
  1249. From: "Cave Newt" <roe2@midway.uchicago.edu>
  1250. To: hankedr@mail.auburn.edu
  1251. Subject: Re:  notes on file39a
  1252.  
  1253. > I've thought a little more on this. The msg "PM executable" implies 
  1254. > "WINDOWAPI", so this is redundant (but perhaps it is consistent with
  1255. > the other types). 
  1256.  
  1257. I think it's fine.
  1258.  
  1259. > I see that someone had hacked the ispell entry (must have caused
  1260. > problems on some system). I think I've fixed this (for both ispell
  1261. > and INI).
  1262.  
  1263. Great!
  1264.  
  1265. >> boom1a.snd:   data
  1266.  
  1267. > I'm not familiar with this one. I do see 
  1268. >  0       string          .snd            audio data:
  1269.  
  1270. I should have looked more closely at it.  I still can't tell if it's
  1271. a standard format or not, but the following entry works (these are
  1272. found in the Nick Macki beta, btw):
  1273.  
  1274. 0    string        Creative\ Voice\ File    audio data (%.19s)
  1275.  
  1276. =============================================================================
  1277.  
  1278. Date:     Thu, 5 Aug 1993 06:21:37 -0400
  1279. From: ian@sq.com
  1280. To: hankedr@mail.auburn.edu
  1281. Subject: Re: file 3.9 for OS/2
  1282. X-Sun-Charset: US-ASCII
  1283. Content-Length: 710
  1284.  
  1285.   Date:    Mon, 2 Aug 1993 08:45:08 -0400
  1286.   From:    Darrel R Hankerson <hankedr@mail.auburn.edu>
  1287.   >I will soon be updating file 3.9 for OS/2 (the original port was 
  1288.   >completed several months ago). I have not received any mail
  1289.   >from you since 
  1290.   >
  1291.   >  Date:   Mon, 5 Apr 1993 10:51:49 -0400
  1292.  
  1293. Sorry, I've not done much with file in several months. I'm thinking of
  1294. turning it over to the FSF so they can bloat (er expand) it over
  1295. time. Or somebody else, I'm not sure yet. It's a bit of a job to
  1296. maintain all the variants and changes.
  1297.  
  1298. Will keep you posted. Thanks.
  1299.  
  1300. Ian
  1301. =============================================================================
  1302.