DATSTP Version 1.3 Gene Pizzetta October 8, 1990 How often have you wanted to change the date stamps for a file or two without having to call up DATSWEEP. Or maybe you wanted to change a P2DOS-type date stamp and DATSWEEP didn't work. Well, here's the answer: DATSTP displays or changes the create and modify date stamps on any file. (Under Z3PLUS, DATSTP will display the file dates, but not change them.) USAGE: DATSTP {dir:}fn.ft {{date} {time} {{/}options}} If no DU or DIR is given, the current drive/user is assumed. If no date/time is given, the current date stamps for the given file will be displayed. If date/time is given, the given file's create date stamp will be updated as the default (but see options M and B, below. OPTIONS: Options should be preceded by a slash, unless they are the fourth parameter on the command line. M Edit and write modify date stamp. Without this option, the creation date stamp will be read into the edit buffer, edited, and then written back to the create stamp on disk. With the M option, the modification date will be read into the edit buffer, edited, and then written back to the modify stamp on disk. B Write to both create and modify date stamps. The edited date is ordinarily written back to the stamp from which it came. With this option, the edited date is written to both the create and modify stamps on disk. Q Toggle current setting of quiet mode. DATSTP checks the ZCPR3 quiet flag when it is invoked and enters quiet mode if the quiet flag is on. If the quiet flag is off, DATSWP then checks a configurable internal quiet flag to determine if it should default to quiet mode. In either case, the Q option toggles off quiet mode, if it is on, and toggles it on, if it is off. On error, DATSTP sets the program error flag to standard error codes listed in Z34ERR.LIB. If an error handler is installed, it will also be invoked. DATE/TIME ENTRY: DATSTP uses a modified version of Carson Wilson's ZSPARSDS module in his ZSLIB. It allows date entry in both European and American order (configurable) and allows both "." and "/" as delimiters in the date field: {mm{/dd{/yy{ hh{:mm}}}}} -- American clock time or {dd{.mm{.yy{ hh{:mm}}}}} -- European clock time Time must always be entered based on a 24-hour clock; i.e., 3:00 p.m. is entered as 15:00. Relative time can also be entered, for those who use that method (but this mode has not been tested): {mm{/dd{/yy{ +nnnn}}}} -- American relative time or {dd{.mm{.yy{ +nnnn}}}} -- European relative time Either periods or slashes may be used as date delimiters with either American or European date order. In the discussion below, American order is assumed. Those using European order will have to make the necessary mental changes. DATSTP does not actually replace the date and time, it edits it. By default, the editing buffer is loaded with the current create date stamp and the command line date applied to it. Any blank fields on the command line remain unchanged in the buffer. For instance, if the current create date is "3/15/89 21:35" and the command line date is DATSTP TEST.DOC /25 then only the day would be changed ("3/25/89 21:35"). If the command line entry was DATSTP TEST.DOC // 9 then only the hour would be changed ("3/15/89 09:35"). There must be a space between the date and time; otherwise, the result will be different: DATSTP TEST.DOC //9 changes the year ("3/15/09 21:35"). With the M option, the modify date stamp will be loaded into the edit buffer instead of the create stamp. If the original date field is empty and you do not give valid entries for at least the day and month fields, you will get an "invalid date/time" error. Whichever date field you choose for editing, the create stamp or the modify stamp (M option), the B option will cause the resulting date to be written to both stamp fields. You can easily move dates between fields. For instance, if you want to move the create date stamp to the modify stamp, use: DATSTP TEST.DOC // /b The create stamp will be loaded into the edit buffer, but, since all date fields are empty, it will not be changed. It will then be written back to both stamp fields per the B option. The modify stamp can also be moved to the create stamp field similarly: DATSTP TEST.DOC // /mb The dates and times displayed are always those actually on disk. If a date is given, DATSTP first reads the current file stamp, modifies it, and then writes in back. Finally, the file stamp read from disk again and displayed. DISTRIBUTED VERSIONS: The distribution library contains four versions of DATSTP. Two of them, with filetype CIM, are type-3 programs that load at 8000h and require ZCPR 3.3 or higher. The COM files load at 100h, the normal address. The DATSTP-Z versions were assembled for ZSDOS and ZDDOS only, using date stamp routines from ZSLIB. They are under 4 K. The DATSTP-U versions were assembled using date stamp routines from DSLIB and are universal. They are larger (about 5K), but they read and write file stamps under ZSDOS, ZDDOS, and ZRDOS with DateStamper. They will also display file stamps under Z3PLUS, although it will not write them. CONFIGURATION: You may use ZCNFG and the DATSTPnn.CFG file to configure defaults to suit yourself. ZCNFG will find the configuration file automatically as long as you don't change its name, even if you change the name of DATSTP.COM. As distributed, DATSTP defaults to verbose operation. You can set it to default to quiet mode, if you wish. Civilian (12-hour) time is used in screen displays in the distributed version, but you can configure DATSTP to use military (24-hour) time. On the command line you must always use 24-hour time. You may also configure DATSTP to display and accept from the command line dates in European order (dd.mm.yy). As distributed, use American date order (mm/dd/yy). ASSEMBLY: DATSTP was developed with SLRMAC and SLRNK+. Linkage also requires PARSDS.REL, ZSLIB.REL (v2.1), and the version 4 libraries. PARSDS is a special version, not the version in ZSLIB: slrmac parsds/m slrmac datstp/m slrnkp datstp/n,/v,/a:100,/j,datstp,parsds,zslib/s,dslib/s, vlib/s,z3lib/s,syslib/s,/e or, for type 3: slrnkp datstp/n,/v,/a:8000,/j,datstp,parsds,zslib/s,dslib/s, vlib/s,z3lib/s,syslib/s,/e Before assembly the equate "ZSDOS" must be set for the version wanted. Setting the equate to "TRUE" creates a version that works only under ZSDOS and ZDDOS, using date stamp routines from ZSLIB. Setting the equate to "FALSE" creates a universal version that also works with DateStamper under ZRDOS, and with Z3PLUS (display only), using date stamp routines from DSLIB. The universal version is 6 records larger, which puts it over 4K, but I think it's a little faster. The usage screen displays "Version Z-n.n" for the ZSDOS or "Version U-n.n" for the universal version. HISTORY: Version 1.3 -- October 8, 1990 -- Gene Pizzetta Incorporates Howard Goldstein's excellent optimizations that cut the code size considerably. Added equates to create a universal version using DSLIB date stamp routines for operation under ZRDOS DateStamper, and under Z3PLUS (display only). ZSDOS version is considerably smaller, however. Corrected lingering bug in the PARSDS module that gave an error when a colon was given that was not followed by a minute specification, but WAS followed by another command line parameter. Version 1.2A -- September 12, 1990 -- Howard Goldstein Optimized code. No functional changes (I hope). Version 1.2 -- September 8, 1990 -- Gene Pizzetta Corrected failure to initialize option B flag. Version 1.1 -- September 7, 1990 -- Gene Pizzetta Improved display, especially for reverse video highlighting. Also corrected a small bug in usage message, and made a few other minor code changes. Version 1.0 -- September 3, 1990 -- Gene Pizzetta Initial release. I tried versions with all the date stamps displayed on a single line, and the multiple line version here released. I personally found the multi-line version much easier to read at a glance, but I'm interested in your input. In addition, I reversed the positions of the access and modify fields in the display. Since this program does not touch the access field, I felt the two fields of concern should be adjacent to each other. Please leave any comments, suggestions, or bug reports on the boards below or on Ladera. Gene Pizzetta 481 Revere Street Revere, MA 02151 Newton Centre Z-Node: (617) 965-7259 GEnie: E.PIZZETTA Voice: (617) 284-0891