file.man 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. .\" $File: file.man,v 1.124 2016/10/19 20:52:45 christos Exp $
  2. .Dd October 19, 2016
  3. .Dt FILE __CSECTION__
  4. .Os
  5. .Sh NAME
  6. .Nm file
  7. .Nd determine file type
  8. .Sh SYNOPSIS
  9. .Nm
  10. .Bk -words
  11. .Op Fl bcdEhiklLNnprsvzZ0
  12. .Op Fl Fl apple
  13. .Op Fl Fl extension
  14. .Op Fl Fl mime-encoding
  15. .Op Fl Fl mime-type
  16. .Op Fl e Ar testname
  17. .Op Fl F Ar separator
  18. .Op Fl f Ar namefile
  19. .Op Fl m Ar magicfiles
  20. .Op Fl P Ar name=value
  21. .Ar
  22. .Ek
  23. .Nm
  24. .Fl C
  25. .Op Fl m Ar magicfiles
  26. .Nm
  27. .Op Fl Fl help
  28. .Sh DESCRIPTION
  29. This manual page documents version __VERSION__ of the
  30. .Nm
  31. command.
  32. .Pp
  33. .Nm
  34. tests each argument in an attempt to classify it.
  35. There are three sets of tests, performed in this order:
  36. filesystem tests, magic tests, and language tests.
  37. The
  38. .Em first
  39. test that succeeds causes the file type to be printed.
  40. .Pp
  41. The type printed will usually contain one of the words
  42. .Em text
  43. (the file contains only
  44. printing characters and a few common control
  45. characters and is probably safe to read on an
  46. .Dv ASCII
  47. terminal),
  48. .Em executable
  49. (the file contains the result of compiling a program
  50. in a form understandable to some
  51. .Tn UNIX
  52. kernel or another),
  53. or
  54. .Em data
  55. meaning anything else (data is usually
  56. .Dq binary
  57. or non-printable).
  58. Exceptions are well-known file formats (core files, tar archives)
  59. that are known to contain binary data.
  60. When modifying magic files or the program itself, make sure to
  61. .Em "preserve these keywords" .
  62. Users depend on knowing that all the readable files in a directory
  63. have the word
  64. .Dq text
  65. printed.
  66. Don't do as Berkeley did and change
  67. .Dq shell commands text
  68. to
  69. .Dq shell script .
  70. .Pp
  71. The filesystem tests are based on examining the return from a
  72. .Xr stat 2
  73. system call.
  74. The program checks to see if the file is empty,
  75. or if it's some sort of special file.
  76. Any known file types appropriate to the system you are running on
  77. (sockets, symbolic links, or named pipes (FIFOs) on those systems that
  78. implement them)
  79. are intuited if they are defined in the system header file
  80. .In sys/stat.h .
  81. .Pp
  82. The magic tests are used to check for files with data in
  83. particular fixed formats.
  84. The canonical example of this is a binary executable (compiled program)
  85. .Dv a.out
  86. file, whose format is defined in
  87. .In elf.h ,
  88. .In a.out.h
  89. and possibly
  90. .In exec.h
  91. in the standard include directory.
  92. These files have a
  93. .Dq "magic number"
  94. stored in a particular place
  95. near the beginning of the file that tells the
  96. .Tn UNIX
  97. operating system
  98. that the file is a binary executable, and which of several types thereof.
  99. The concept of a
  100. .Dq "magic"
  101. has been applied by extension to data files.
  102. Any file with some invariant identifier at a small fixed
  103. offset into the file can usually be described in this way.
  104. The information identifying these files is read from the compiled
  105. magic file
  106. .Pa __MAGIC__.mgc ,
  107. or the files in the directory
  108. .Pa __MAGIC__
  109. if the compiled file does not exist.
  110. In addition, if
  111. .Pa $HOME/.magic.mgc
  112. or
  113. .Pa $HOME/.magic
  114. exists, it will be used in preference to the system magic files.
  115. .Pp
  116. If a file does not match any of the entries in the magic file,
  117. it is examined to see if it seems to be a text file.
  118. ASCII, ISO-8859-x, non-ISO 8-bit extended-ASCII character sets
  119. (such as those used on Macintosh and IBM PC systems),
  120. UTF-8-encoded Unicode, UTF-16-encoded Unicode, and EBCDIC
  121. character sets can be distinguished by the different
  122. ranges and sequences of bytes that constitute printable text
  123. in each set.
  124. If a file passes any of these tests, its character set is reported.
  125. ASCII, ISO-8859-x, UTF-8, and extended-ASCII files are identified
  126. as
  127. .Dq text
  128. because they will be mostly readable on nearly any terminal;
  129. UTF-16 and EBCDIC are only
  130. .Dq character data
  131. because, while
  132. they contain text, it is text that will require translation
  133. before it can be read.
  134. In addition,
  135. .Nm
  136. will attempt to determine other characteristics of text-type files.
  137. If the lines of a file are terminated by CR, CRLF, or NEL, instead
  138. of the Unix-standard LF, this will be reported.
  139. Files that contain embedded escape sequences or overstriking
  140. will also be identified.
  141. .Pp
  142. Once
  143. .Nm
  144. has determined the character set used in a text-type file,
  145. it will
  146. attempt to determine in what language the file is written.
  147. The language tests look for particular strings (cf.
  148. .In names.h )
  149. that can appear anywhere in the first few blocks of a file.
  150. For example, the keyword
  151. .Em .br
  152. indicates that the file is most likely a
  153. .Xr troff 1
  154. input file, just as the keyword
  155. .Em struct
  156. indicates a C program.
  157. These tests are less reliable than the previous
  158. two groups, so they are performed last.
  159. The language test routines also test for some miscellany
  160. (such as
  161. .Xr tar 1
  162. archives).
  163. .Pp
  164. Any file that cannot be identified as having been written
  165. in any of the character sets listed above is simply said to be
  166. .Dq data .
  167. .Sh OPTIONS
  168. .Bl -tag -width indent
  169. .It Fl Fl apple
  170. Causes the file command to output the file type and creator code as
  171. used by older MacOS versions. The code consists of eight letters,
  172. the first describing the file type, the latter the creator.
  173. .It Fl b , Fl Fl brief
  174. Do not prepend filenames to output lines (brief mode).
  175. .It Fl C , Fl Fl compile
  176. Write a
  177. .Pa magic.mgc
  178. output file that contains a pre-parsed version of the magic file or directory.
  179. .It Fl c , Fl Fl checking-printout
  180. Cause a checking printout of the parsed form of the magic file.
  181. This is usually used in conjunction with the
  182. .Fl m
  183. flag to debug a new magic file before installing it.
  184. .It Fl d
  185. Prints internal debugging information to stderr.
  186. .It Fl E
  187. On filesystem errors (file not found etc), instead of handling the error
  188. as regular output as POSIX mandates and keep going, issue an error message
  189. and exit.
  190. .It Fl e , Fl Fl exclude Ar testname
  191. Exclude the test named in
  192. .Ar testname
  193. from the list of tests made to determine the file type.
  194. Valid test names are:
  195. .Bl -tag -width compress
  196. .It apptype
  197. .Dv EMX
  198. application type (only on EMX).
  199. .It ascii
  200. Various types of text files (this test will try to guess the text
  201. encoding, irrespective of the setting of the
  202. .Sq encoding
  203. option).
  204. .It encoding
  205. Different text encodings for soft magic tests.
  206. .It tokens
  207. Ignored for backwards compatibility.
  208. .It cdf
  209. Prints details of Compound Document Files.
  210. .It compress
  211. Checks for, and looks inside, compressed files.
  212. .It elf
  213. Prints ELF file details, provided soft magic tests are enabled and the
  214. elf magic is found.
  215. .It soft
  216. Consults magic files.
  217. .It tar
  218. Examines tar files.
  219. .It text
  220. A synonym for
  221. .Sq ascii .
  222. .El
  223. .It Fl Fl extension
  224. Print a slash-separated list of valid extensions for the file type found.
  225. .It Fl F , Fl Fl separator Ar separator
  226. Use the specified string as the separator between the filename and the
  227. file result returned.
  228. Defaults to
  229. .Sq \&: .
  230. .It Fl f , Fl Fl files-from Ar namefile
  231. Read the names of the files to be examined from
  232. .Ar namefile
  233. (one per line)
  234. before the argument list.
  235. Either
  236. .Ar namefile
  237. or at least one filename argument must be present;
  238. to test the standard input, use
  239. .Sq -
  240. as a filename argument.
  241. Please note that
  242. .Ar namefile
  243. is unwrapped and the enclosed filenames are processed when this option is
  244. encountered and before any further options processing is done.
  245. This allows one to process multiple lists of files with different command line
  246. arguments on the same
  247. .Nm
  248. invocation.
  249. Thus if you want to set the delimiter, you need to do it before you specify
  250. the list of files, like:
  251. .Dq Fl F Ar @ Fl f Ar namefile ,
  252. instead of:
  253. .Dq Fl f Ar namefile Fl F Ar @ .
  254. .It Fl h , Fl Fl no-dereference
  255. option causes symlinks not to be followed
  256. (on systems that support symbolic links).
  257. This is the default if the environment variable
  258. .Dv POSIXLY_CORRECT
  259. is not defined.
  260. .It Fl i , Fl Fl mime
  261. Causes the file command to output mime type strings rather than the more
  262. traditional human readable ones.
  263. Thus it may say
  264. .Sq text/plain; charset=us-ascii
  265. rather than
  266. .Dq ASCII text .
  267. .It Fl Fl mime-type , Fl Fl mime-encoding
  268. Like
  269. .Fl i ,
  270. but print only the specified element(s).
  271. .It Fl k , Fl Fl keep-going
  272. Don't stop at the first match, keep going.
  273. Subsequent matches will be
  274. have the string
  275. .Sq "\[rs]012\- "
  276. prepended.
  277. (If you want a newline, see the
  278. .Fl r
  279. option.)
  280. The magic pattern with the highest strength (see the
  281. .Fl l
  282. option) comes first.
  283. .It Fl l , Fl Fl list
  284. Shows a list of patterns and their strength sorted descending by
  285. .Xr magic 4
  286. strength
  287. which is used for the matching (see also the
  288. .Fl k
  289. option).
  290. .It Fl L , Fl Fl dereference
  291. option causes symlinks to be followed, as the like-named option in
  292. .Xr ls 1
  293. (on systems that support symbolic links).
  294. This is the default if the environment variable
  295. .Ev POSIXLY_CORRECT
  296. is defined.
  297. .It Fl m , Fl Fl magic-file Ar magicfiles
  298. Specify an alternate list of files and directories containing magic.
  299. This can be a single item, or a colon-separated list.
  300. If a compiled magic file is found alongside a file or directory,
  301. it will be used instead.
  302. .It Fl N , Fl Fl no-pad
  303. Don't pad filenames so that they align in the output.
  304. .It Fl n , Fl Fl no-buffer
  305. Force stdout to be flushed after checking each file.
  306. This is only useful if checking a list of files.
  307. It is intended to be used by programs that want filetype output from a pipe.
  308. .It Fl p , Fl Fl preserve-date
  309. On systems that support
  310. .Xr utime 3
  311. or
  312. .Xr utimes 2 ,
  313. attempt to preserve the access time of files analyzed, to pretend that
  314. .Nm
  315. never read them.
  316. .It Fl P , Fl Fl parameter Ar name=value
  317. Set various parameter limits.
  318. .Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
  319. .It Sy "Name" Ta Sy "Default" Ta Sy "Explanation"
  320. .It Li indir Ta 15 Ta recursion limit for indirect magic
  321. .It Li name Ta 30 Ta use count limit for name/use magic
  322. .It Li elf_notes Ta 256 Ta max ELF notes processed
  323. .It Li elf_phnum Ta 128 Ta max ELF program sections processed
  324. .It Li elf_shnum Ta 32768 Ta max ELF sections processed
  325. .It Li regex Ta 8192 Ta length limit for regex searches
  326. .It Li bytes Ta 1048576 Ta max number of bytes to read from file
  327. .El
  328. .It Fl r , Fl Fl raw
  329. Don't translate unprintable characters to \eooo.
  330. Normally
  331. .Nm
  332. translates unprintable characters to their octal representation.
  333. .It Fl s , Fl Fl special-files
  334. Normally,
  335. .Nm
  336. only attempts to read and determine the type of argument files which
  337. .Xr stat 2
  338. reports are ordinary files.
  339. This prevents problems, because reading special files may have peculiar
  340. consequences.
  341. Specifying the
  342. .Fl s
  343. option causes
  344. .Nm
  345. to also read argument files which are block or character special files.
  346. This is useful for determining the filesystem types of the data in raw
  347. disk partitions, which are block special files.
  348. This option also causes
  349. .Nm
  350. to disregard the file size as reported by
  351. .Xr stat 2
  352. since on some systems it reports a zero size for raw disk partitions.
  353. .It Fl v , Fl Fl version
  354. Print the version of the program and exit.
  355. .It Fl z , Fl Fl uncompress
  356. Try to look inside compressed files.
  357. .It Fl Z , Fl Fl uncompress-noreport
  358. Try to look inside compressed files, but report information about the contents
  359. only not the compression.
  360. .It Fl 0 , Fl Fl print0
  361. Output a null character
  362. .Sq \e0
  363. after the end of the filename.
  364. Nice to
  365. .Xr cut 1
  366. the output.
  367. This does not affect the separator, which is still printed.
  368. .Pp
  369. If this option is repeated more than once, then
  370. .Nm
  371. prints just the filename followed by a NUL followed by the description
  372. (or ERROR: text) followed by a second NUL for each entry.
  373. .It Fl -help
  374. Print a help message and exit.
  375. .El
  376. .Sh FILES
  377. .Bl -tag -width __MAGIC__.mgc -compact
  378. .It Pa __MAGIC__.mgc
  379. Default compiled list of magic.
  380. .It Pa __MAGIC__
  381. Directory containing default magic files.
  382. .El
  383. .Sh ENVIRONMENT
  384. The environment variable
  385. .Ev MAGIC
  386. can be used to set the default magic file name.
  387. If that variable is set, then
  388. .Nm
  389. will not attempt to open
  390. .Pa $HOME/.magic .
  391. .Nm
  392. adds
  393. .Dq Pa .mgc
  394. to the value of this variable as appropriate.
  395. However,
  396. .Pa file
  397. has to exist in order for
  398. .Pa file.mime
  399. to be considered.
  400. The environment variable
  401. .Ev POSIXLY_CORRECT
  402. controls (on systems that support symbolic links), whether
  403. .Nm
  404. will attempt to follow symlinks or not.
  405. If set, then
  406. .Nm
  407. follows symlink, otherwise it does not.
  408. This is also controlled by the
  409. .Fl L
  410. and
  411. .Fl h
  412. options.
  413. .Sh SEE ALSO
  414. .Xr magic __FSECTION__ ,
  415. .Xr hexdump 1 ,
  416. .Xr od 1 ,
  417. .Xr strings 1 ,
  418. .Sh STANDARDS CONFORMANCE
  419. This program is believed to exceed the System V Interface Definition
  420. of FILE(CMD), as near as one can determine from the vague language
  421. contained therein.
  422. Its behavior is mostly compatible with the System V program of the same name.
  423. This version knows more magic, however, so it will produce
  424. different (albeit more accurate) output in many cases.
  425. .\" URL: http://www.opengroup.org/onlinepubs/009695399/utilities/file.html
  426. .Pp
  427. The one significant difference
  428. between this version and System V
  429. is that this version treats any white space
  430. as a delimiter, so that spaces in pattern strings must be escaped.
  431. For example,
  432. .Bd -literal -offset indent
  433. \*[Gt]10 string language impress\ (imPRESS data)
  434. .Ed
  435. .Pp
  436. in an existing magic file would have to be changed to
  437. .Bd -literal -offset indent
  438. \*[Gt]10 string language\e impress (imPRESS data)
  439. .Ed
  440. .Pp
  441. In addition, in this version, if a pattern string contains a backslash,
  442. it must be escaped.
  443. For example
  444. .Bd -literal -offset indent
  445. 0 string \ebegindata Andrew Toolkit document
  446. .Ed
  447. .Pp
  448. in an existing magic file would have to be changed to
  449. .Bd -literal -offset indent
  450. 0 string \e\ebegindata Andrew Toolkit document
  451. .Ed
  452. .Pp
  453. SunOS releases 3.2 and later from Sun Microsystems include a
  454. .Nm
  455. command derived from the System V one, but with some extensions.
  456. This version differs from Sun's only in minor ways.
  457. It includes the extension of the
  458. .Sq \*[Am]
  459. operator, used as,
  460. for example,
  461. .Bd -literal -offset indent
  462. \*[Gt]16 long\*[Am]0x7fffffff \*[Gt]0 not stripped
  463. .Ed
  464. .Sh MAGIC DIRECTORY
  465. The magic file entries have been collected from various sources,
  466. mainly USENET, and contributed by various authors.
  467. Christos Zoulas (address below) will collect additional
  468. or corrected magic file entries.
  469. A consolidation of magic file entries
  470. will be distributed periodically.
  471. .Pp
  472. The order of entries in the magic file is significant.
  473. Depending on what system you are using, the order that
  474. they are put together may be incorrect.
  475. If your old
  476. .Nm
  477. command uses a magic file,
  478. keep the old magic file around for comparison purposes
  479. (rename it to
  480. .Pa __MAGIC__.orig ) .
  481. .Sh EXAMPLES
  482. .Bd -literal -offset indent
  483. $ file file.c file /dev/{wd0a,hda}
  484. file.c: C program text
  485. file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
  486. dynamically linked (uses shared libs), stripped
  487. /dev/wd0a: block special (0/0)
  488. /dev/hda: block special (3/0)
  489. $ file -s /dev/wd0{b,d}
  490. /dev/wd0b: data
  491. /dev/wd0d: x86 boot sector
  492. $ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10}
  493. /dev/hda: x86 boot sector
  494. /dev/hda1: Linux/i386 ext2 filesystem
  495. /dev/hda2: x86 boot sector
  496. /dev/hda3: x86 boot sector, extended partition table
  497. /dev/hda4: Linux/i386 ext2 filesystem
  498. /dev/hda5: Linux/i386 swap file
  499. /dev/hda6: Linux/i386 swap file
  500. /dev/hda7: Linux/i386 swap file
  501. /dev/hda8: Linux/i386 swap file
  502. /dev/hda9: empty
  503. /dev/hda10: empty
  504. $ file -i file.c file /dev/{wd0a,hda}
  505. file.c: text/x-c
  506. file: application/x-executable
  507. /dev/hda: application/x-not-regular-file
  508. /dev/wd0a: application/x-not-regular-file
  509. .Ed
  510. .Sh HISTORY
  511. There has been a
  512. .Nm
  513. command in every
  514. .Dv UNIX since at least Research Version 4
  515. (man page dated November, 1973).
  516. The System V version introduced one significant major change:
  517. the external list of magic types.
  518. This slowed the program down slightly but made it a lot more flexible.
  519. .Pp
  520. This program, based on the System V version,
  521. was written by Ian Darwin
  522. .Aq ian@darwinsys.com
  523. without looking at anybody else's source code.
  524. .Pp
  525. John Gilmore revised the code extensively, making it better than
  526. the first version.
  527. Geoff Collyer found several inadequacies
  528. and provided some magic file entries.
  529. Contributions by the
  530. .Sq \*[Am]
  531. operator by Rob McMahon,
  532. .Aq cudcv@warwick.ac.uk ,
  533. 1989.
  534. .Pp
  535. Guy Harris,
  536. .Aq guy@netapp.com ,
  537. made many changes from 1993 to the present.
  538. 1989.
  539. .Pp
  540. Primary development and maintenance from 1990 to the present by
  541. Christos Zoulas
  542. .Aq christos@astron.com .
  543. .Pp
  544. Altered by Chris Lowth
  545. .Aq chris@lowth.com ,
  546. 2000: handle the
  547. .Fl i
  548. option to output mime type strings, using an alternative
  549. magic file and internal logic.
  550. .Pp
  551. Altered by Eric Fischer
  552. .Aq enf@pobox.com ,
  553. July, 2000,
  554. to identify character codes and attempt to identify the languages
  555. of non-ASCII files.
  556. .Pp
  557. Altered by Reuben Thomas
  558. .Aq rrt@sc3d.org ,
  559. 2007-2011, to improve MIME support, merge MIME and non-MIME magic,
  560. support directories as well as files of magic, apply many bug fixes,
  561. update and fix a lot of magic, improve the build system, improve the
  562. documentation, and rewrite the Python bindings in pure Python.
  563. .Pp
  564. The list of contributors to the
  565. .Sq magic
  566. directory (magic files)
  567. is too long to include here.
  568. You know who you are; thank you.
  569. Many contributors are listed in the source files.
  570. .Sh LEGAL NOTICE
  571. Copyright (c) Ian F. Darwin, Toronto, Canada, 1986-1999.
  572. Covered by the standard Berkeley Software Distribution copyright; see the file
  573. COPYING in the source distribution.
  574. .Pp
  575. The files
  576. .Pa tar.h
  577. and
  578. .Pa is_tar.c
  579. were written by John Gilmore from his public-domain
  580. .Xr tar 1
  581. program, and are not covered by the above license.
  582. .Sh RETURN CODE
  583. .Nm
  584. returns 0 on success, and non-zero on error.
  585. .Sh BUGS
  586. .Pp
  587. Please report bugs and send patches to the bug tracker at
  588. .Pa http://bugs.gw.com/
  589. or the mailing list at
  590. .Aq file@mx.gw.com
  591. (visit
  592. .Pa http://mx.gw.com/mailman/listinfo/file
  593. first to subscribe).
  594. .Sh TODO
  595. .Pp
  596. Fix output so that tests for MIME and APPLE flags are not needed all
  597. over the place, and actual output is only done in one place.
  598. This needs a design.
  599. Suggestion: push possible outputs on to a list, then pick the
  600. last-pushed (most specific, one hopes) value at the end, or
  601. use a default if the list is empty.
  602. This should not slow down evaluation.
  603. .Pp
  604. The handling of
  605. .Dv MAGIC_CONTINUE
  606. and printing \e012- between entries is clumsy and complicated; refactor
  607. and centralize.
  608. .Pp
  609. Some of the encoding logic is hard-coded in encoding.c and can be moved
  610. to the magic files if we had a !:charset annotation
  611. .Pp
  612. Continue to squash all magic bugs.
  613. See Debian BTS for a good source.
  614. .Pp
  615. Store arbitrarily long strings, for example for %s patterns, so that
  616. they can be printed out.
  617. Fixes Debian bug #271672.
  618. This can be done by allocating strings in a string pool, storing the
  619. string pool at the end of the magic file and converting all the string
  620. pointers to relative offsets from the string pool.
  621. .Pp
  622. Add syntax for relative offsets after current level (Debian bug #466037).
  623. .Pp
  624. Make file -ki work, i.e. give multiple MIME types.
  625. .Pp
  626. Add a zip library so we can peek inside Office2007 documents to
  627. print more details about their contents.
  628. .Pp
  629. Add an option to print URLs for the sources of the file descriptions.
  630. .Pp
  631. Combine script searches and add a way to map executable names to MIME
  632. types (e.g. have a magic value for !:mime which causes the resulting
  633. string to be looked up in a table).
  634. This would avoid adding the same magic repeatedly for each new
  635. hash-bang interpreter.
  636. .Pp
  637. When a file descriptor is available, we can skip and adjust the buffer
  638. instead of the hacky buffer management we do now.
  639. .Pp
  640. Fix
  641. .Dq name
  642. and
  643. .Dq use
  644. to check for consistency at compile time (duplicate
  645. .Dq name ,
  646. .Dq use
  647. pointing to undefined
  648. .Dq name
  649. ).
  650. Make
  651. .Dq name
  652. /
  653. .Dq use
  654. more efficient by keeping a sorted list of names.
  655. Special-case ^ to flip endianness in the parser so that it does not
  656. have to be escaped, and document it.
  657. .Pp
  658. If the offsets specified internally in the file exceed the buffer size
  659. (
  660. .Dv HOWMANY
  661. variable in file.h), then we don't seek to that offset, but we give up.
  662. It would be better if buffer managements was done when the file descriptor
  663. is available so move around the file.
  664. One must be careful though because this has performance (and thus security
  665. considerations).
  666. .Sh AVAILABILITY
  667. You can obtain the original author's latest version by anonymous FTP
  668. on
  669. .Pa ftp.astron.com
  670. in the directory
  671. .Pa /pub/file/file-X.YZ.tar.gz .