home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 16 / FREEDOS.ZIP / FD_A4PRE.ZIP / HELP / TOUCH < prev    next >
Text File  |  1995-06-28  |  9KB  |  212 lines

  1.     Program usage documentation for the Free-DOS TOUCH program
  2.  
  3.     (c) Copyright 1995 by K. Heidenstrom.
  4.  
  5.     Modified:
  6.  
  7.     KH.19950605.001  (TOUCH 1.4.0)    First version
  8.  
  9. 1.  LEGAL
  10.  
  11.     This program is Copyright 1989-1995 by K. Heidenstrom.    The author
  12.     may be reached at kheidens@actrix.gen.nz on the Internet or by snail
  13.     mail: K. Heidenstrom c/- P.O. Box 27-103, Wellington, New Zealand.
  14.  
  15.     This program is free software.    You may redistribute the source and
  16.     executable and/or modify the program under the terms of the GNU
  17.     General Public License as published by the Free Software Foundation;
  18.     either version 2 of the License, or (at your option) any later version.
  19.  
  20.     This program is distributed in the hope that it will be useful,
  21.     but is provided "as-is", without any warranty of any kind, including
  22.     the implied warranty of merchantability or fitness for a particular
  23.     purpose.  In no event will the author be liable for any damages of
  24.     any kind related to the use of this program.  See the GNU General
  25.     Public License for more details.
  26.  
  27.     You should have received a copy of the GNU General Public License
  28.     along with this program; if not, write to the Free Software
  29.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  30.  
  31. 2.  FUNCTION AND USAGE SYNTAX
  32.  
  33.     The TOUCH program modifies the date and/or time of files on disk.
  34.     TOUCH is originally from the Unix operating system, and there are
  35.     many other DOS ports of this utility.  This implementation has the
  36.     following features.
  37.  
  38.     TOUCH allows the date, time, or both date and time of the file to be
  39.     modified.  TOUCH can set the date and time to the current date and
  40.     time, or to any date and time specified by the user.  The date and time
  41.     can also be set to zero, which causes the values to be displayed as
  42.     blank in the directory listing under some versions of DOS.
  43.  
  44.     TOUCH can also scan the file for a textual version string and set the
  45.     file time according to the value of the string.  I find this useful as
  46.     the version number of the program can be seen at a glance from the
  47.     directory listing.  I first noticed this convention of setting the file
  48.     time according to the version number on PKWARE products, and it has
  49.     been adopted by many software companies.
  50.  
  51.     The program usage syntax is:
  52.  
  53.     TOUCH [-?] [-C] [-F] [Date] [Time] Pathspec [...]
  54.  
  55.     Parameters may be specified in any order.  More than one Date is not
  56.     allowed.  More than one Time is also not allowed.  The 'Pathspec' may
  57.     be repeated as needed.    Each Pathspec specifies a file or group of
  58.     files to be touched, and may contain an initial drive specification,
  59.     a directory path specification, and/or a file specification, and may
  60.     specify a group of files (using the '?' and '*' wildcard characters)
  61.     or a single file (an unambiguous specification).
  62.  
  63.     If a directory is specified, with no file specification, the default
  64.     file mask of '*.*' is appended.  This can also be forced by specifying
  65.     a trailing backslash.
  66.  
  67.     All parameters are case-insensitive.  Switches may begin with '-' or
  68.     with the currently active DOS switch character (switchar) which is
  69.     normally '/'.  TOUCH does not support the forward slash as a directory
  70.     separator character, regardless of the setting of the switchar.  The -C
  71.     and -F option switches may be run together into -CF or -FC.
  72.  
  73.     If no parameters are specified, or the -? parameter is specified, or if
  74.     an illegal number is specified, the program issues a usage summary
  75.     message and terminates, returning errorlevel 255.
  76.  
  77. 2.1.  DATE PARAMETER
  78.  
  79.     The Date and Time parameters are distinguished from Pathspecs according
  80.     to the characters they contain.  A date must be formatted as:
  81.  
  82.         nn-nn-nn
  83.  
  84.     where each 'nn' is a one or more digit number, and the '-' character
  85.     may alternatively be a '/' or the date separator character provided
  86.     by DOS according to the country number specified in your CONFIG.SYS
  87.     file.  Usually this will be a '-' though it may be a '.' in Japan.
  88.     Whatever the two date separator characters are, they must be the same.
  89.  
  90.     The order in which the numbers are interpreted depends on the country
  91.     number.  There are three standard date orders:
  92.  
  93.         mm-dd-yy    (American)
  94.         dd-mm-yy    (European)
  95.         yy.mm.dd    (Japanese)
  96.  
  97.     The year may be specified in full (e.g. 1995) in which case it must be
  98.     in the range 1980 to 2099 inclusive.  It may be specified in shorthand
  99.     form as two digits in the range 80 to 99, in which case it is assumed
  100.     to be 19xx where xx are the two digits supplied, or as two digits in
  101.     the range 00 to 79, in which case it is assumed to be 20xx where xx are
  102.     the two digits supplied.
  103.  
  104.     A date value of 0-0-0 may be specified.  With some versions of DOS
  105.     (3.30, I believe, and possibly others), this will result in the date
  106.     column in the directory listing being blank.
  107.  
  108. 2.2.  TIME PARAMETER
  109.  
  110.     A time parameter must be formatted as:
  111.  
  112.         hh:mm[:ss]
  113.  
  114.     where each value is a one or more digit number.  The second colon and
  115.     the 'ss' value are optional.  If they are not given, a seconds value
  116.     of zero will be used.
  117.  
  118.     A time value of 0:0 may be specified.  With some versions of DOS (as
  119.     noted earlier), this will result in the time column in the directory
  120.     listing being blank.
  121.  
  122. 2.3.  TOUCH DATE AND TIME SETTING BEHAVIOUR
  123.  
  124.     If date and time values are both present, each file will be touched to
  125.     that date and time.  If only one value is present, each file will be
  126.     touched to that value but the other will be unchanged; in other words,
  127.     if only a date is specified, each file will have its date set to the
  128.     specified date but its time will be unchanged, or if only a time is
  129.     specified, each file will have its time set to the specified time but
  130.     its date will be unchanged.  For files created by TOUCH, values that
  131.     are not specified will be the current value at the date and time when
  132.     TOUCH was started.
  133.  
  134.     If neither date nor time are specified, the current date and time are
  135.     used (unless the -F switch is present).  TOUCH reads the current date
  136.     and time once when it starts up, so regardless of how many files are
  137.     touched, they will all be touched to the same date and time.
  138.  
  139. 2.4.  THE -C OPTION
  140.  
  141.     TOUCH will (by default) create files specified unambiguously (i.e.
  142.     named explicitly, without wildcards) if they don't already exist.
  143.     This is apparently the behaviour of the Unix 'touch', though it is
  144.     not usual in DOS implementations.  This feature can be overridden
  145.     by the -C command line switch, which tells TOUCH not to create the
  146.     specified file if it does not already exist.
  147.  
  148.     For example, the command TOUCH NOSUCH.FIL (if NOSUCH.FIL does not
  149.     already exist), will create an empty (zero bytes long) file called
  150.     NOSUCH.FIL.  The command TOUCH -C NOSUCH.FIL will report an error
  151.     and will not create the file.
  152.  
  153. 2.5.  THE -F OPTION
  154.  
  155.     The -F option specifies touching the file(s) according to the version
  156.     strings within each file.  If this option is specified, the Date and
  157.     Time parameters must not be specified.    TOUCH will scan the contents
  158.     of each file for a string indicating the file's version number.  It
  159.     scans only the first 48K (approximately) of the file.  The version
  160.     string is taken in two parts - the 'version' string, and the version
  161.     number.  The 'version' string is matched using a case-insensitive
  162.     comparison.  Recognised strings are:
  163.  
  164.         "version "
  165.         "vers "
  166.         "vers. "
  167.         "ver "
  168.         "ver. "
  169.         "v "
  170.         "v."
  171.         "v"
  172.  
  173.     Immediately following the 'version' string is the version number, which
  174.     may be in any of the following forms (where 'x', 'y', and 'z' are
  175.     single digits):
  176.  
  177.         "x"
  178.         "x.y"
  179.         "x.yz"
  180.         "x.y.z"
  181.  
  182.     The 'x' and 'z' values must both be in the range 0 to 9.  The 'y' value
  183.     must be in the range 0 to 5.
  184.  
  185.     The file will be touched with a time value created from the values
  186.     given, so that the time stamp indicates the version number.  For
  187.     example, if the ; version number in the file is 2.12, it will be
  188.     touched to 2:12 a.m.  Its date will be unchanged.
  189.  
  190.     If TOUCH cannot locate a version string in the file, it will issue an
  191.     error message, leave the file date and time unmodified, and continue
  192.     processing.
  193.  
  194.     If the file was created by TOUCH (i.e. the file specified was an
  195.     unambiguous pathname that did not already exist), TOUCH will not scan
  196.     the file for a version string if -F is specified; TOUCH will just touch
  197.     the file with the current date and time.  No error message is issued.
  198.  
  199. 2.6.  ERRORLEVELS
  200.  
  201.     TOUCH always reports an errorlevel when it terminates.    This may be
  202.     useful when TOUCH is used within batch files.  A message will be also
  203.     issued if an error occurs.  The errorlevels that may be returned by
  204.     TOUCH are as follows:
  205.  
  206.     0    Normal completion; no errors
  207.     2    One or more errors occurred during processing
  208.     162    Insufficient memory (approx. 64K of memory is required)
  209.     255    Incorrect usage syntax
  210.  
  211.                    ----//----
  212.