home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJDEV201.ZIP / info / utils.inf < prev   
Encoding:
GNU Info File  |  1996-01-23  |  17.8 KB  |  497 lines

  1. This is Info file ../../info/utils.inf, produced by Makeinfo-1.63 from
  2. the input file utils.tex.
  3.  
  4. This is the reference manual for DJGPP V2's miscellaneous utilities
  5.  
  6. Copyright (c) 1995 DJ Delorie
  7.  
  8. 
  9. File: utils,  Node: Top,  Up: (dir)
  10.  
  11. This is the reference manual for the miscellaneous utility programs that
  12. come with DJGPP.
  13.  
  14. * Menu:
  15.  
  16.  
  17. * bin2h::       Convert binary data files to C include files.
  18.  
  19. * djtar::       Extract or list files from (possibly compressed)
  20.         tar archives, with DOS filename conversion.
  21.  
  22. * dtou::        Convert text files from dos to unix.
  23. * utod::        Convert text files from unix to dos.
  24.  
  25. * echo::        Echo long command lines to files.
  26.  
  27. * gxx::         Build and link C++ programs
  28.  
  29. * redir::       Manage I/O Redirection.
  30.  
  31. * split::       split large files into multiple files.
  32. * merge::       Merge multiple files into one file.
  33.  
  34. * texi2ps::     Convert texinfo files to Postscript.
  35.  
  36. * update::      conditionally copy one file to another.
  37.  
  38. 
  39. File: utils,  Node: bin2h,  Next: djtar,  Up: Top
  40.  
  41. bin2h
  42. *****
  43.  
  44. `bin2h' allows a developer to embed a binary file into a source file,
  45. bu converting the binary data to an array of integer values.
  46.  
  47. Usage: `bin2h' `datafile' SYMBOL `headerfile'
  48.  
  49. The resulting header file has a format like this:
  50.  
  51.      unsigned char symbol[] = {
  52.        ... data ...
  53.      };
  54.  
  55. 
  56. File: utils,  Node: djtar,  Next: dtou,  Prev: bin2h,  Up: Top
  57.  
  58. djtar
  59. *****
  60.  
  61. Usage: `djtar' [`-n' `changeFile'] [`-o' `dir'] [`-t'|`-x'] [`-i']
  62. [`-v'] [`-p'] [`-.'|`-!.'] [`-d'|`-u'|`-b'] `tarfile'
  63.  
  64. `djtar' is a program that is designed to ease the problems related to
  65. extracting Unix tar files on a DOS machine.  The long file names and
  66. illegal characters make regular tar programs useless.  What `djtar'
  67. does is make some obvious name conversions automatically and give you an
  68. opportunity to provide alternate names for more difficult cases, where
  69. several filenames map to the same name in the restricted 8+3 DOS
  70. filename space.
  71.  
  72. `djtar' can read compressed tar files and decompress them on the fly.
  73. (This can be also achieved by piping the output of `gzip' to `djtar',
  74. but for very large archives you can run out of free disk space, because
  75. DOS implements pipes as temporary disk files.) `djtar' knows about all
  76. the compression methods supported by `gzip', namely, deflation (aka
  77. LZ77, either by `gzip', by `zip', or by `pkzip'), LZW compression (by
  78. `compress'), LZH compression (as with `compress -H' available with some
  79. versions of `compress'), or Huffman compression (by `pack').  Tar files
  80. compressed with `zip' or `pkzip' can be decompressed by `djtar' only if
  81. the `.zip' file contains a single tar file compressed with either the
  82. `deflation' or `stored' (i.e., uncompressed, like with `pkzip -e0')
  83. methods; if more than a single tar file was put into a compressed zip
  84. file, files beyond the first one will be ignored by `djtar' (a message
  85. to this effect will be printed under `-v' option).
  86.  
  87. `djtar' can also read tar archives (compressed or otherwise) written on
  88. a Unix machine to a diskette as a raw device (i.e., without DOS
  89. filesystem).  To use `djtar' with such archives, specify a name of the
  90. drive (like `A:') as a tarfile argument.
  91.  
  92. When extracting files from compressed archives, `djtar' will validate
  93. them with whatever reduntant checks are available with the compression
  94. format, and print diagnostic messages whenever these checks fail.  The
  95. checks and the diagnostics are generally identical to those performed
  96. by `gzip'.  Some of the diagnostics are only printed under the verbose
  97. operation switched on by the `-v' switch.  Unless you use the `-i'
  98. switch, `djtar' will refuse to create files and directories beyond the
  99. first tar directory entry which fails the checksum test; this usually
  100. means the file is either corrupted or not in a valid tar format.
  101.  
  102. An additional bonus of using `djtar' is that it can convert Unix-style
  103. text files to DOS-style text files, and vice versa.  By default, it
  104. will write all files exactly as found in the archive, but the `-u' and
  105. `-d' options can change that.
  106.  
  107. `djtar' performs a number of file name conversions in an attempt to
  108. make the files fit into MS-DOS's restricted file names.  Any file
  109. ending in `.info-N' becomes `.iN'.  Any file ending in `.tar.gz'
  110. becomes `.tgz'.  Any file with `++' becomes `plus'.  Any leading dots
  111. are changed to underscores (but current and parent directories, `./'
  112. and `../' are left alone).  Any remaining multiple dots are changed to
  113. dashes, unless the part before the dot is shorter than 3 characters and
  114. there are more than 1 dot in the filename, in which case the dot also
  115. becomes an underscore.  As a result, e.g., `.foo.a.b' becomes
  116. `_foo.a-b', and `sh.lex.c' becomes `sh_lex.c'.
  117.  
  118. While `djtar' is running, if it cannot successfully perform an
  119. exclusive open of the given file (it will refuse to overwrite an
  120. existing file), it will prompt you for a new name.  You may type in
  121. either a complete path, a replacement file name (no directory part), or
  122. just hit return (the file is skipped).
  123.  
  124. If `djtar' is called as `djtart', it behaves as if it were called with
  125. the `-t' switch; when called as `djtarx', it behaves like `djtar -x'.
  126. Thus you can create 2 links to `djtar.exe' which will save you some
  127. typing.
  128.  
  129. By default, `djtar' just lists the contents of the archive(s) given as
  130. its arguments.  If you want to extract files, you must use the `-x'
  131. option.
  132.  
  133. *Options:*
  134.  
  135. `-x'
  136.      By default, `djtar' just lists the contents of the archive(s)
  137.      given as its arguments.  If you want to extract files, you must use
  138.      this option, or call `djtar' via a link named `djtarx'.
  139.  
  140. `-t'
  141.      This option causes `djtar' to only print the contents of the tar
  142.      file, without actually creating any files.  All the decompression,
  143.      CRC checks etc. are still performed; thus, this option can also be
  144.      used to test archive integrity.  This is the default behavior of
  145.      `djtar', unless you call it via a link named `djtarx'.
  146.  
  147. `-v'
  148.      This option modifies the output format slightly to aid in
  149.      debugging tar file problems.  It also causes `djtar' to emit more
  150.      verbose warning messages and print the compression method for
  151.      compressed archices.
  152.  
  153. `-.'
  154.      Enable the automatic conversion of dots to underscores and dashes.
  155.      This is the default.
  156.  
  157. `-!.'
  158.      Disable the conversion of dots.  You get the control of file
  159.      renaming when names of several files clash.
  160.  
  161. `-n `changeFile''
  162.      This option allows you to specify a list of filename conversions
  163.      ahead of time.  Thus, you can use `djtart' or `djtar -t' to list
  164.      the files, figure out the new names with your favorite editor, and
  165.      supply that file to `djtar'.  This way, you have the fullest
  166.      possible control on how the extracted files will be named on your
  167.      system.
  168.  
  169.      The format of the `changeFile' file is like this:
  170.  
  171.           dir/dir/dir/old.name.here  dir/dir/dir/newname.hre
  172.           dir/dir/dir/old2.name.here  dir/dir/dir/newname2.hre
  173.  
  174.      The directories must be complete, not relative.  The "old"
  175.      directories must match the complete path in the tar file, and the
  176.      "new" directories indicate where the file goes on the DOS disk.
  177.  
  178. `-d'
  179.      Convert all text files to DOS text format on output.  This won't
  180.      usually affect binary files, but as `djtar' detects the file type
  181.      by looking at its first 512 bytes, a small possibility of a binary
  182.      file rendered useless by this conversion still exists, so you're
  183.      advised to only use this option with archives of text files.
  184.  
  185.      By default, `djtar' writes all files exactly as it finds them.
  186.  
  187. `-u'
  188.      Convert all text files to UNIX text format on output.  This won't
  189.      usually affect binary files, but as `djtar' detects the file type
  190.      by looking at its first 512 bytes, a small possibility of a binary
  191.      file rendered useless by this conversion still exists, so you're
  192.      advised to only use this option with archives of text files.
  193.  
  194.      By default, `djtar' writes all files exactly as it finds them.
  195.  
  196. `-b'
  197.      Write all files exactly as found in the archive.  This is the
  198.      default.  Files written to the console (when `-p' is in effect)
  199.      are always written in text mode, so this option doesn't have any
  200.      effect when used with `-p', unless the output of `djtar' is
  201.      redirected to a file or a pipe.
  202.  
  203. `-o `dir''
  204.      Only extract files which are children of the given directory `dir'.
  205.      This option can be used to extract portions of archive.  Files
  206.      which aren't extracted will still be shown, but with a string `[
  207.      skipped ]' appended to their names.  When given the `-o' option,
  208.      `djtar' actually checks if `dir' is contained in filenames as a
  209.      substring, so you can specify incomplete directory names, thus
  210.      using it as a poor man's wildcard facility.
  211.  
  212. `-i'
  213.      By default, `djtar' will refuse to create files whose directory
  214.      entries in the tar archive fail the checksum test, and any files
  215.      beyond that point.  This option tells `djtar' to ignore the
  216.      checksum test and proceed anyway.  Checksum failure usually means
  217.      that the tar file is either corrupted or not in valid tar format,
  218.      so this option is meant to be used either with the `-t' option, or
  219.      in the rare cases when you *know* for sure the tar file is valid
  220.      (like if you had to edit it to change the filenames).
  221.  
  222. `-p'
  223.      When given this switch, `djtar' will write the files to its
  224.      standard output, which can be piped into another program (like a
  225.      pager) or redirected to a file.  This option is designed to allow
  226.      you to view or extract individual files (e.g., the `README' files)
  227.      without having to open the entire archive, and should be used with
  228.      an appropriate `-o filename' option.
  229.  
  230.      When this option is used, diagnostic messages will be directed to
  231.      the standard error stream (as opposed to standard output in normal
  232.      operation), so that they won't get mixed with the files' data.
  233.  
  234. 
  235. File: utils,  Node: dtou,  Next: utod,  Prev: djtar,  Up: Top
  236.  
  237. dtou
  238. ****
  239.  
  240. Each file specified on the command line is converted from dos's CR/LF
  241. text file mode to unix's NL text file mode.
  242.  
  243. All djgpp wildcards are supported.  Timestamps of the files are
  244. preserved.
  245.  
  246. 
  247. File: utils,  Node: utod,  Next: echo,  Prev: dtou,  Up: Top
  248.  
  249. utod
  250. ****
  251.  
  252. Each file specified on the command line is converted from unix's NL text
  253. file mode to dos's CR/LF text file mode.
  254.  
  255. All djgpp wildcards are supported.  Timestamps of the files are
  256. preserved.
  257.  
  258. 
  259. File: utils,  Node: echo,  Next: gxx,  Prev: utod,  Up: Top
  260.  
  261. echo
  262. ****
  263.  
  264. This program simply echos whatever is given to it on the command line.
  265.  
  266. Usage: `echo' [`-n'] [`-o' FILE] stuff . . .
  267.  
  268. `-n'
  269.      Do not emit the trailing newline after printing the text.
  270.  
  271. `-o FILE'
  272.      Send output to a FILE.
  273.  
  274. The purpose of this program is to be able to interact directly with
  275. `make''s ability to pass long command lines to programs.  If you use
  276. redirection, you aren't always able to handle long command lines.  With
  277. `echo', you can, and you can use the `-o' option to redirect output to
  278. a file (and use the file later as a response file) without using dos's
  279. redirection.
  280.  
  281. 
  282. File: utils,  Node: gxx,  Next: redir,  Prev: echo,  Up: Top
  283.  
  284. gxx
  285. ***
  286.  
  287. This program is exactly like `gcc' (in fact, it calls gcc), except that
  288. it provides the extra libraries required to link most C++ programs,
  289. including the iostreams, stdc, and libg++ libraries.
  290.  
  291. 
  292. File: utils,  Node: redir,  Next: split,  Prev: gxx,  Up: Top
  293.  
  294. redir
  295. *****
  296.  
  297. DOS, in its many flavors and versions, lacks a decent I/O redirection
  298. mechanism.  Sure, it's got < and > and >>, but what about error
  299. messages?  Lots of people ask, "How do you send those error messages to
  300. a file?"  Well, you use a program like `redir'.
  301.  
  302. `redir' is basically a program that manipulates the standard file
  303. descriptors by copying them, closing and opening them, etc.  Once it
  304. has the file descriptors where it wants them, it runs your program,
  305. which inherits the changed descriptors.  Thus, `redir' has nearly
  306. complete control over the input and output of your program.
  307.  
  308. It also allows you to view the exit code of the program, and the
  309. elapsed time of the program, by supplying the appropriate options on
  310. the command line.
  311.  
  312. Note that `redir' is built with command-line expansion and response
  313. files disabled, so as to allow the application to control that
  314. themselves.  This means that you can't use those features to provide
  315. `redir''s options or the command name, but if you use them for the
  316. command's options, the command will do the expansion if it wants to.
  317.  
  318. The exit code of `redir' is 1 if it exits on its own accord, else it
  319. returns the same error code as the program it runs.
  320.  
  321. Usage: `redir' [`-i' FILE] [`-o' FILE] [`-oa' FILE] [`-e' FILE] [`-ea'
  322. FILE] [`-eo'] [`-oe'] [`-x'] [`-t'] COMMAND [ARGS . . .]
  323.  
  324. `-i FILE'
  325.      Redirect stdandard input from file
  326.  
  327. `-o FILE'
  328.      Redirect standard output to file
  329.  
  330. `-oa FILE'
  331.      Append standard output to file
  332.  
  333. `-e FILE'
  334.      Redirect standard error to file
  335.  
  336. `-ea FILE'
  337.      Append standard error to file
  338.  
  339. `-eo'
  340.      Redirect standard error to standard output
  341.  
  342. `-oe'
  343.      Redirect standard output to standard error
  344.  
  345. `-x'
  346.      Print the exit code of the command after it exits.  If the exit
  347.      code is 0..255, it is printed as is.  If it is not, the low byte
  348.      (0..255) is printed in decimal and the whole value is also printed
  349.      in hex.
  350.  
  351. `-t'
  352.      Print elapsed time, either in seconds (for short runs) or
  353.      hours:minutes:seconds.
  354.  
  355. Options are processed in the order they are encountered.  Thus, "-o foo
  356. -eo" means "redirect output to foo, then redirect errors there also",
  357. whereas "-eo -o foo" means "send errors to where output was going, then
  358. move output to foo".
  359.  
  360. Examples:
  361.  
  362. To redirect errors to a file:
  363.  
  364.      redir -e errors.lst command ...
  365.  
  366. To redirect output to a file, and errors through a pipe:
  367.  
  368.      redir -eo -o prog.out command ... | pipe
  369.  
  370. 
  371. File: utils,  Node: split,  Next: merge,  Prev: redir,  Up: Top
  372.  
  373. split
  374. *****
  375.  
  376. The `split' and `merge' programs are designed to assist in transporting
  377. files across unreliable channels or small media (like floppies).
  378. `split' takes a big file and splits it into up to 1000 smaller files.
  379. `merge' puts them back together again.
  380.  
  381. Usage: `split' INPUTFILE CHUNKSIZE OUTPUTBASE
  382.  
  383. Each output file is made from appending a sequence number to
  384. OUTPUTBASE.  For example:
  385.  
  386.      split foo.tgz 1300k footgz
  387.  
  388. would result in `footgz.000', `footgz.001', etc.
  389.  
  390. The `chunksize' parameter can be expressed as bytes (NNN),
  391. kilobytes(NNNk) or megabytes (NNNm).
  392.  
  393. 
  394. File: utils,  Node: merge,  Next: texi2ps,  Prev: split,  Up: Top
  395.  
  396. merge
  397. *****
  398.  
  399. The `split' and `merge' programs are designed to assist in transporting
  400. files across unreliable channels or small media (like floppies).
  401. `split' takes a big file and splits it into up to 1000 smaller files.
  402. `merge' puts them back together again.
  403.  
  404. Usage: `split' INPUTBASE OUTPUTFILE
  405.  
  406. Each input file is made from appending a sequence number to INPUTBASE.
  407. For example, given `footgz.000', `footgz.001', etc,
  408.  
  409.      merge footgz foo.tgz
  410.  
  411. would result in `foo.tgz' being created.
  412.  
  413. 
  414. File: utils,  Node: texi2ps,  Next: update,  Prev: merge,  Up: Top
  415.  
  416. texi2ps
  417. *******
  418.  
  419. `texi2ps' is a modified version of `makeinfo' that quickly turns
  420. texinfo files (such as info files are generated from) into crude
  421. Postscript files, ready for printing.  The program is designed to
  422. produce a crude page, so please don't complain if the printed copy looks
  423. ugly.  If you want clean pages, get and install TeX and print it with
  424. that.  It will produce a much cleaner print.  I'm also pretty sure that
  425. texi2ps won't support 100% of the texinfo documents out there.  Again,
  426. if you want it right use TeX.
  427.  
  428. Note that the input files are texinfo files, not TeX or LaTeX or info
  429. files.  In normal djgpp distributions, the texinfo files are part of
  430. the source distributions, and the info files are in the binary
  431. distributions.
  432.  
  433. The default settings produce a pretty densely packed page - small font,
  434. small margins.  You can set the margins and font even smaller to save on
  435. paper, or make them bigger for more conventional manuals.
  436.  
  437. Usage: `texi2ps' [`-f' SIZE] [`-I' DIR] [`-I'DIR] [`-v'] [`-m' PTS] FILE
  438.  
  439. `-f SIZE'
  440.      The font size, in points.  The default is 10 points.
  441.  
  442. `-I PATH'
  443.      Specifies an additional path to search for include files.
  444.  
  445. `-v'
  446.      Print verbose messages about files read, nodes encountered, and
  447.      pages generated.
  448.  
  449. `-m PTS'
  450.      Set the margin size in points.  The default is 54 points, or 3/4
  451.      inches (72 points = 1 inch).
  452.  
  453. Note that the Postscript file is sent to standard output, so you must
  454. redirect the output to a file or a printer.
  455.  
  456. 
  457. File: utils,  Node: update,  Prev: texi2ps,  Up: Top
  458.  
  459. update
  460. ******
  461.  
  462. `update' is a fancy copy-if-needed program.  Basically, it compares the
  463. two files you give it, and if they differ, copies one to the other.
  464. This is useful in makefiles where a file is generated often, but its
  465. contents changes rarely, and other files depend on it.  For example,
  466. `bison' emits a header file each time it parses the grammar.  The
  467. header rarely changes, but the grammar changes often.  So, you use
  468. `update' to copy the header to its real name only when it changes, and
  469. everything else won't need to be recompiled each time.
  470.  
  471. Usage: `update' NEW_FILE COPIED_TO
  472.  
  473. Example:
  474.  
  475.      foo.c foo.h : foo.y
  476.              bison foo.y
  477.              update y_tab.h foo.h
  478.              update y_tab.c foo.c
  479.  
  480.  
  481. 
  482. Tag Table:
  483. Node: Top198
  484. Node: bin2h976
  485. Node: djtar1333
  486. Node: dtou9987
  487. Node: utod10254
  488. Node: echo10520
  489. Node: gxx11185
  490. Node: redir11452
  491. Node: split13957
  492. Node: merge14599
  493. Node: texi2ps15158
  494. Node: update16723
  495. 
  496. End Tag Table
  497.