From - Thu Oct 30 07:38:04 1997
Path: news.mitre.org!blanket.mitre.org!news.tufts.edu!cam-news-feed5.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news.mathworks.com!mvb.saic.com!info-vax
From: MICHALECZ@scigames.at
Newsgroups: comp.os.vms
Subject: WG: Any utility to set/modify file dates/times ?
Message-ID: <c=AT%a=_%p=Telecontrol%l=TCDC1-971030082237Z-3534@scigames.at>
Date: Thu, 30 Oct 1997 09:22:37 +0100
Organization: Info-Vax<==>Comp.Os.Vms Gateway
X-Gateway-Source-Info: Mailing List
Lines: 142

>Setting the modification dates can be performed via XAB's (RMS Calls).
>Here is some example routine in PASCAL to perform this operation.
>(Sorry, I'm not allowed to publish the complete utility).
>
>Note that this example get's the desired date from a "database-file". You
>will
>have to adapt this for your needs.
>
>{============================================================================
>==}
>FUNCTION MOD_DATE_FILE (    FNAM : VARYING[U] OF CHAR;
>		        VAR DB   : DB_FILE_$T ) : INTEGER;
>{============================================================================
>==}
>{
>{   FUNCTIONAL DESCRIPTION:
>{
>{
>{   RETURN VALUE:
>{
>{       VMS Status
>{
>{   %[EXCEPTIONS]%
>{   %[INTERNALS]%
>{============================================================================
>==}
>VAR
>    STAT    : TCLIB_STAT_$T;
>
>VAR
>    FAB	    : [STATIC] FAB$TYPE	:= ZERO;
>    NAM	    : [STATIC] NAM$TYPE	:= ZERO;
>    XAB_MD  : [STATIC] XAB$TYPE	:= ZERO;
>    XAB_CD  : [STATIC] XAB$TYPE	:= ZERO;
>     
>BEGIN
>    {----------------------------------------}
>    { fill NAM
>    {----------------------------------------}
>    NAM := ZERO;
>    NAM.NAM$B_BID := NAM$C_BID;
>    NAM.NAM$B_BLN := NAM$C_BLN;
>
>    {----------------------------------------}
>    { fill FAB 
>    {----------------------------------------}
>    FAB := ZERO;
>    FAB.FAB$B_BID := FAB$C_BID;
>    FAB.FAB$B_BLN := FAB$C_BLN;
>    
>    FAB.FAB$B_FAC := FAB$M_PUT; { required to force update by $CLOSE }
>    FAB.FAB$B_SHR := FAB$M_UPI;	{ no locking }
>				 
>    FAB.FAB$L_FNA := IADDRESS( FNAM.BODY );
>    FAB.FAB$B_FNS := FNAM.LENGTH;
>
>    FAB.FAB$L_NAM := IADDRESS( NAM );
>
>    {----------------------------------------}
>    { fill in XABs (and link them)
>    {----------------------------------------}
>
>    XAB_CD.XAB$B_COD := XAB$C_DAT;
>    XAB_CD.XAB$B_BLN := XAB$C_DATLEN;
>
>    XAB_MD.XAB$B_COD := XAB$C_RDT;
>    XAB_MD.XAB$B_BLN := XAB$C_RDTLEN;
>    XAB_MD.XAB$L_NXT := IADDRESS( XAB_CD );
>
>    FAB.FAB$L_XAB := IADDRESS( XAB_MD );
>
>    {----------------------------------------}
>    { open file (and fill NAM, XAB)
>    {----------------------------------------}
>    STAT := $OPEN (FAB);
>    IF NOT ODD( STAT )  THEN RETURN STAT;
>
>    IF NAM.NAM$B_FID_RVN <> 0 THEN STAT := TCTOOLS__SETFIL_UNSRVN;
>    IF NAM.NAM$B_FID_NMX <> 0 THEN STAT := TCTOOLS__SETFIL_UNSNMX;
>    IF NOT ODD( STAT )
>    THEN
>	BEGIN
>	$CLOSE( FAB );
>	RETURN STAT;
>	END;        
>
>    {----------------------------------------}
>    { GET modification date
>    {----------------------------------------}
>    FINDK( DB, 0, NAM.NAM$W_FID_NUM,
>    	   EQL, ERROR := CONTINUE );
>    IF UFB( DB ) THEN RETURN TCTOOLS__SETFIL_FNF;	
>
>    {----------------------------------------}
>    { set new modification date
>    {----------------------------------------}
>    XAB_MD.XAB$Q_RDT := DB^.MODTIM_$Q;
>
>    {----------------------------------------}
>    { close file (and update modification date
>    {----------------------------------------}
>    STAT := $CLOSE (FAB);
>    IF NOT ODD( STAT )  THEN RETURN STAT;
>
>    RETURN STAT;
>END;
>
>Martin Michalecz
>
>*****************************************************************************
>************
>
>Dipl. Ing. Martin Michalecz
>
>Scientific Games AG
>Klitschgasse 2-4
>A-1130 Wien
>AUSTRIA
>
>E-mail: MICHALECZ@scigames.at
>Phone: + 43 1 80100 0 
>Fax: + 43 1 80100 25
>
>
>
>----------
>Von: 	Bob Lombard[SMTP:blombard@spawar.navy.mil]
>Gesendet: 	Mittwoch, 29. Oktober 1997 23:12
>An: 	Info-VAX@Mvb.Saic.Com
>Betreff: 	Any utility to set/modify file dates/times ?
>
>Can anyone point me toward some sort of utility to modify file dates
>and/or times (almost like 'touch' in the unix world) ?  I'd like to be
>able to set all files in a given relase to a common date/time.
>
>I have'nt been able to see any way to do this in the gray books.
>
>TIA for all constructive help..
>
>blombard@spawar.navy.mil
>
>
