🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.xedit-l
Article #760

Re: Editing a file w/o changing the date the file was acces'd

#760
From: Otto Stolz
Date: Thu, 25 Jun 1992 16:29
54 lines
2936 bytes
On Thu, 25 Jun 1992 08:41:27 CST Jim Piatt said:
> My understanding is that if I use an XEDIT
> Macro which "files' [...] the date will
> change to the current date.  Is there a way around this.

Very simple -- well almost...

Your EXEC could preserve the old file-creation date with an auxiliary
file, using COPYFILE's OLDDATE option, e.g. in the following way (not
tested):
  /* ... */
  signal on novalue
  address command
  trace o

  /* check arguments */
  token. = "*"
  "PARSECMD 49M.DISCARD"; mrc = rc
  if mrc=0
  then do
     /* find files named by arguments */
     "MAKEBUF"; buffer_level = rc; stack_level = queued()
     "LISTFILE" token.2 token.3 token.4 "( FMODE STACK NOH"; mrc = rc
     do queued() - stack_level /* for every file found */
        parse pull fn ft fm .
        f0 = fn ft       fm
        f1 = fn "SYSUT4" fm
        /* data-transformation, preserving file-creation date */
        "COPYFILE"              f0    f1 "( FOR 1  OLDDATE REPLACE
        if rc=0 then "XEDIT"    f0       "( PROFILE" your_miracle_macro
        if rc=0 then "COPYFILE" f1 f0 f0 "(        OLDDATE REPLACE"
        if rc=0 then "COPYFILE" f0       "( FROM 2 OLDDATE REPLACE"
        mrc = max(rc, mrc)
        "ERASE" f1
     end /* queued() - stack_level */
     "DROPBUF" buffer_level
  end /* rc=0 */
  exit mrc

Of course, your production EXEC would apply more sophistication: it could
handle even input files on a R/O disk or with strange filemodes (say A3);
or it could avoid one COPYFILE command if the particular XEDIT profile
(your_miracle_macro) would file its results directly to an auxiliary
file. In any case, there's no need to tinker with the file-creation date:
simply preserve the old date, as required.

If you have CMS-Pipelines available, you may want to use that product (or
perhaps offering) rather than XEDIT to do the actual data transformation.
It works much more efficient than XEDIT (storage-wise, and probably also
time-wise), and it may turn out easier to be programmed.

Best regards,
                    Otto Stolz <RZOTTO@DKNKURZ1.Bitnet>
                               <RZOTTO@nyx.uni-konstanz.de>
Technical Details
Message-ID: <XEDIT-L%92062513091368@OHSTVMA.IRCC.OHIO-STATE.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!auvm!DKNKURZ1.BITNET!RZOTTO

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c92b,e5d796443e77092a
X-Google-Attributes: gid10c92b,public
X-Google-ArrivalTime: 1992-06-25 06:20:58 PST
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!auvm!DKNKURZ1.BITNET!RZOTTO
X-Acknowledge-To: <RZOTTO@DKNKURZ1>
Message-ID: <XEDIT-L%92062513091368@OHSTVMA.IRCC.OHIO-STATE.EDU>
Newsgroups: bit.listserv.xedit-l
Date:         Thu, 25 Jun 1992 17:29:38 MEZ
Sender:       VM System Editor List <XEDIT-L@UGA.BITNET>
From:         Otto Stolz <RZOTTO@DKNKURZ1.BITNET>
Subject:      Re: Editing a file w/o changing the date the file was acces'd
In-Reply-To:  Message of Thu, 25 Jun 1992 08:41:27 CST from <PIATT@CMSUVMA>
Lines: 54