Article 141730 of comp.os.vms:
Path: nntpd.lkg.dec.com!eps.enet.dec.com!vandenheuvel
From: vandenheuvel@eps.enet.dec.com (Hein RMS van den Heuvel)
Newsgroups: comp.os.vms
Subject: Re: System service to get a file's date
Date: 5 MAR 96 17:09:02
Organization: Digital Equipment Corporation
Lines: 43
Message-ID: <4hfpv4$49p@nntpd.lkg.dec.com>
References: <4hfl7h$e8b@dfw-ixnews1.ix.netcom.com>
NNTP-Posting-Host: heer.enet.dec.com


In article <4hfl7h$e8b@dfw-ixnews1.ix.netcom.com>, chirsrch@ix.netcom.com (CHI Research, Inc. ) writes...
>DOes anyone know of a system service to return a file's date?  Ideally,
>the date returned should be the user's option, like --
>date = system_service (file, 'Revision')

The included program gives a small example.

>I once did this by looking at the FAB, but I found that I opened the
>file, and thereby changed the revision date!! 

You must have opened it specifyin some level of write access: FAB$B_FAC
having bits set for PUT, DEL and/or UPD.

#include descrip
#include stdio
#include RMS
main(int argc, char *argv[])
{
    struct FAB fab = cc$rms_fab;
    struct XABDAT dat = cc$rms_xabdat;
    int	stat;
    char   ascii_date[24];	
    $DESCRIPTOR (date_dx, ascii_date);

    fab.fab$l_fna = argv[1];
    fab.fab$b_fns = strlen(fab.fab$l_fna);
    fab.fab$b_shr = FAB$M_UPI;
    fab.fab$l_xab = &dat;
    stat = sys$open ( &fab );
    if (stat & 1)
	{
	stat = sys$asctim ( 0, &date_dx, &dat.xab$q_cdt, 0);
	ascii_date[23]=0;
	printf ("Creation date = %s\n", ascii_date);
 	}
    return stat;
}

Hope this helps,		+--------------------------------------+
Hein van den Heuvel, Digital.	| All opinions expressed are mine, and |
  "Makers of VMS and other	| may not reflect those of my employer |
   fine Operating Systems."	+--------------------------------------+


