Dec 242017
 
Updates a files DATE to the current date. By W. Parke.
File REDATE14.ZIP from The Programmer’s Corner in
Category File Managers
Updates a files DATE to the current date. By W. Parke.
File Name File Size Zip Size Zip Type
REDATE.COM 2335 1710 deflated
REDATE.DOC 7981 3272 deflated

Download File REDATE14.ZIP Here

Contents of the REDATE.DOC file




REDATE Ver. 1.4

(c) Copyright 1986,'89
William C. Parke
1820 S Street NW
Washington, D.C. 20009

DISTRIBUTION
------------
REDATE Version 1.4 may be freely copied and distributed as long as the
only charge is for media and reproduction costs. Under no circumstances
should the program be distributed with a commercial product, sold for
profit, or distributed in modified form without express permission of
the author.

DESCRIPTION
-----------
REDATE is a utility used to change the date on one or more files to a
date specified by the user. There is no MS-DOS utility to perform this
function, largely as a protective measure to preserve the creation date
of a file. However, there are circumstances when changing a file
creation date is justified.

An obvious need for redating a file occurs when the file is created
while the DOS date and time are incorrectly set.

A second circumstance is the redating of files contained on a copy of a
software distribution disk to give those files one common date. This is
very handy for later sorting out these files from others created later
in a common directory on a hard disk. Of course, it would not be wise to
alter any files on the original of any distribution disk.

A third circumstance arises in the production of a set of associated
files, such as a newly created executable file and its accompanying
documentation file. Making these files have a common date and time
chronologically links them together. The importance of this intimate
linkage may supercede the ability to trace the exact time of file
creation.

There are several good utilities currently available for changing the
date on a file, such as NEWDATE and FDATE. However, neither of these
allow wild-card specification of the files to be changed. Others allow
wild cards but not a path prefix. REDATE probably has the most flexible
file, date and time input format of any such program.

REDATE requires MS-DOS or PC-DOS Version 2.11 or higher.

COMMAND LINE SYNTAX
------- ---- ------

REDATE filename {{newdate} {newtime}} {/s}

Filename:
--------
The 'filename' may include a path name, and may contain 'wild-cards'
such as '?' or '*'.

Newdate:
-------
The 'newdate' specifies the new Year, Month, and Day. REDATE will accept
all popular methods of specifying these numbers. For example, for the
date December 31, 1988, the following forms are possible and equivalent:

Format Date Specification
-------------------------------------------------------
Dec 31 88 ASCII Month, Day, Year
Dec 31, 1988 USA correspondence format
31 Dec 88 Day, ASCII Month, Year
31 Dec 1988 European format
31-Dec-88 SD format (Sorted Directory by J.Stetson)
12-31-88 USA DOS DIR format
12/31/88 USA Shorthand
88/12-31 Logical Delineated Order
88 12 31 Logical Separated Order
881231 Compressed

Date abbreviations are:

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec,

with letters in upper or lower case.

A year after 1999 requires four digits (e.g. 2001). If no new date is
specified, REDATE keeps the current file date.

Newtime:
-------
The 'newtime' specifies Hour, Minute, and Seconds requested for the file
date. If no 'newdate' was given, then the 'newtime' hours and minutes
must be separated by a colon. Otherwise, colon or blanks can be used to
separate the two digit fields. If no new time is specified, REDATE keeps
the current file time. If the seconds value is not given, a zero second
value will be assumed. Both 24 hour and 12 hour with 'am' and 'pm' time
are allowed with or without a space separation between the time value
and the abbreviation for ante meridiem or post meridiem.

The following 'newtime's give equivalent results:

Format Time Specification
--------------------------------
13:01:01 Full Military
13:1:1 Short Military
130101 Compressed
13 01 01 Separated
13 1 1 Short Separated
13 1 1 Short Expanded
01:01:01 pm Full Meridiem
1:01 pm Short Meridiem
1:01p DOS DIR format

Note that DOS specifies file creation times to within a 2 second
resolution. REDATE rounds the seconds specified to the next lowest even
number. MS-DOS has no provision for specifying time zones, making actual
astronomical time of file creation ambiguous.

If the new time is given as 0:0:0, DOS will no longer display a
time-of-creation for the file with the DIR command.

Switches:
--------
The {/s} shown in the command line syntax indicates an optional switch.

The /C switch can be used instead of a date or time to give the
specified file the current system date and time.

Using the /N switch will eliminate both the creation date and time
fields for the specified file(s) so that DOS will no longer display
these fields. This may be useful if one wishes the creation date and
time to be undisclosed. A space is not required before the switch
character.

Examples:
----------------
REDATE T*.COM January 1, 1989 6:12:05 resets the files date and time.
REDATE TEST.COM 2:10 pm resets the file time only.
REDATE *.EXE 00:00:00 removes time stamp from files.
REDATE TEST.* 29 Oct 1983 resets the files date only.
REDATE A:\DIR\TEST.ASM 12-Dec-84 resets the file date only.
REDATE TE??.OBJ /C changes files to DOS date/time.
REDATE TEST.EXE /N eliminates file date and time.

Batch Applications:
------------------
For batch file use of REDATE, the following ERRORLEVELs are set:

1 - MS-DOS Version number insufficient.
2 - Command line syntax error.
3 - Specified file not found.
4 - Time syntax error.
5 - A specified file was write protected.
6 - The date/time on a specified file could not be set.
7 - Incorrect switch specified.

To prevent screen output of error messages in a batch file, use:

REDATE filename newdate >NUL

which will redirect console output to the NUL device.

ERROR MESSAGES
----- --------
* [Help Screen]
No filename or newdate given.

* DOS 2.11 or higher needed.
Use MS-DOS Version 2.11 or higher.

* {file} not found.
No files match the given file name(s).

* Error in Command Line Syntax: {type}
The newdate is incorrectly specified or a command line switch is
incorrect. Be sure all date and time fields are specified, and each is
limited to valid numeric ranges for that field. To help find the syntax
error, a description of the type of syntax error will be shown. These
are:

Date & Time or File not found
Incomplete Date & Time
Time
Date
Year
Month
Day
Hour
Minute
Seconds

An error is generated if the given fields do not fall in the ranges
below:
Year: 80-99 or 1980-2099
Month: 1-12
Day: 1-31
Hour: 0-23
Minute: 0-59
Seconds: 0-59

* Cannot redate file: {file}.
DOS was unable to reset the date and time for this file. This error may
occur for a single write protected file among a set of files when a
wild-card file name was given. The other files in the set will still be
redated.

Version Revision History:

1.1 Jun, 1987 Added '/N' switch.
1.2 Dec, 1988 Added 'free form' date specification.
1.3 Jan, 1989 Expanded 'free form' dates, added 20xx years.
Added '/C' switch.
Added recognition of 'am' and 'pm' times.
1.4 Jan, 1989 Correct path handling.
Cosmetic changes.



 December 24, 2017  Add comments

Leave a Reply