Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

SET FILE/ATTR=REVDATE doesn't work?

SOLVED
Go to solution
CA1225221
Visitor

SET FILE/ATTR=REVDATE doesn't work?

SET FILE/ATTR=REVDATE does not appear to work. The REVDATE ends up as the current date/time. It might be that the REVDATE is correctly set but then because the file was just modified, REVDATE is set again - thereby making the command pointless.

 

Is this just me?

 

Environment is Itanium, V8.4, ODS-2

 

NB: Changing to ODS-5 is *not* an option.

 

There appears to be an undocument /[NO]RECORD qualifier but it doesn't seem to make any difference.

5 REPLIES
Steven Schweda
Honored Contributor

Re: SET FILE/ATTR=REVDATE doesn't work?

> Is this just me?

   No.  Same behavior on my "COMPAQ Professional Workstation XP1000
running OpenVMS V8.3".  I know nothing, but I suspect that your analysis
is correct.  <fabdef.h> mentions FIB$M_NORECORD and fib$v_norecord,
which can be used to access the magic bit.  (It's used in Info-ZIP UnZip
[.vms]vms.c:stamp_file().)

> NB: Changing to ODS-5 is *not* an option.

   It looks to me as if it wouldn't actually help, either.

> There appears to be an undocument /[NO]RECORD qualifier but it doesn't
> seem to make any difference.

   Perhaps when someone gets it to work, it'll be documented.

Hein van den Heuvel
Honored Contributor

Re: SET FILE/ATTR=REVDATE doesn't work?

 

Pretty dumb huh? I seem to recall someone even defending the behaviour.

 

Anyway..  Macro and Cobol workarounds by yours truly in answers to comp.os.vms topic "manually resetting file revision dates"

 

https://groups.google.com/d/topic/comp.os.vms/RPIayAr6Vm0/discussion

 

C workaround below.

 

Hein.

 

#include descrip
#include stdio
#include RMS
main(int argc, char *argv[])
{
    struct FAB fab = cc$rms_fab;
    struct XABRDT dat = cc$rms_xabrdt;
    int stat;
    int date_dx[2];

    if (argc < 3) {
        printf ("Usage: %s <file-name> <revision-date>\n", argv[0]);
        return 1;
        }
    date_dx[0] = strlen (argv[2]);
    date_dx[1] = (int) argv[2];
    fab.fab$l_fna = argv[1];
    fab.fab$b_fns = strlen(fab.fab$l_fna);
    fab.fab$b_fac = FAB$M_PUT;
    fab.fab$l_xab = &dat;

    stat = sys$open ( &fab );
    if (stat & 1) stat = sys$bintim ( date_dx, &dat.xab$q_rdt);
    if (stat & 1) stat = sys$close ( &fab );
    return stat;
}

 

H.Becker
Honored Contributor

Re: SET FILE/ATTR=REVDATE doesn't work?

>> NB: Changing to ODS-5 is *not* an option.
>
>   It looks to me as if it wouldn't actually help, either.

 

Right, but it is different:

 

$ del x.x;*
$ copy nl: x.x
$ pipe dir/full x.x |search sys$pipe "Created:"/wind=(0,8)
Created:    13-FEB-2013 09:36:25.07
Revised:    13-FEB-2013 09:36:25.07 (1)
Expires:    <None specified>
Backup:     <No backup recorded>
Effective:  <None specified>
Recording:  <None specified>
Accessed:   <None specified>
Attributes: <None specified>
Modified:   <None specified>
$ set file/att=revdate="11-FEB-2011 11:11:11.11" x.x
$ pipe dir/full x.x |search sys$pipe "Created:"/wind=(0,8)
Created:    13-FEB-2013 09:36:25.07
Revised:    13-FEB-2013 09:36:39.30 (2)
Expires:    <None specified>
Backup:     <No backup recorded>
Effective:  <None specified>
Recording:  <None specified>
Accessed:   <None specified>
Attributes: <None specified>
Modified:   <None specified>
$ set file/att=attdate="11-FEB-2011 11:11:11.11" x.x
$ pipe dir/full x.x |search sys$pipe "Created:"/wind=(0,8)
Created:    13-FEB-2013 09:36:25.07
Revised:    11-FEB-2011 11:11:11.11 (2)
Expires:    <None specified>
Backup:     <No backup recorded>
Effective:  <None specified>
Recording:  <None specified>
Accessed:   <None specified>
Attributes: <None specified>
Modified:   <None specified>
$

 

$ del x.x;*
$ copy nl: x.x
$ pipe dump /header x.x |search sys$pipe " date:","revision number:"
    Revision number:                      1
    Creation date:                        13-FEB-2013 09:42:11.05
    Revision date:                        13-FEB-2013 09:42:11.05
    Expiration date:                      <none specified>
    Backup date:                          <none specified>
    Last access date:                     13-FEB-2013 09:42:11.05
    Last attribute change date:           13-FEB-2013 09:42:11.05
$ set file/att=revdate="11-FEB-2011 11:11:11.11" x.x
$ pipe dump /header x.x |search sys$pipe " date:","revision number:"
    Revision number:                      2
    Creation date:                        13-FEB-2013 09:42:11.05
    Revision date:                        11-FEB-2011 11:11:11.11
    Expiration date:                      <none specified>
    Backup date:                          <none specified>
    Last access date:                     13-FEB-2013 09:42:11.05
    Last attribute change date:           13-FEB-2013 09:42:34.78
$ set file/att=attdate="11-FEB-2011 11:11:11.11" x.x
$ pipe dump /header x.x |search sys$pipe " date:","revision number:"
    Revision number:                      2
    Creation date:                        13-FEB-2013 09:42:11.05
    Revision date:                        11-FEB-2011 11:11:11.11
    Expiration date:                      <none specified>
    Backup date:                          <none specified>
    Last access date:                     13-FEB-2013 09:42:11.05
    Last attribute change date:           11-FEB-2011 11:11:11.11
$

Craig A Berry
Honored Contributor

Re: SET FILE/ATTR=REVDATE doesn't work?

See Joe Meadows' FILE utility for an example of how to do it by setting up a $QIO that updates the FIB after setting fib$l_acctl to FIB$M_NORECORD in order to keep your update from being recorded. 

 

Or be lazy (like me) and use Perl:

 

$ perl -e "utime undef,undef,$ARGV[0];" x.x

 

or if you envision being lazy in exactly the same way on a regular basis, set up a symbol and use that:

 

$ touch :== "''perl' -e ""utime undef,undef,$ARGV[0];"""
$ touch x.x

 

or for VMS versions later than 7.3, you can probably use the CRTL's utime() in your own program.

H.Becker
Honored Contributor
Solution

Re: SET FILE/ATTR=REVDATE doesn't work?

For ODS2, to set the revdate, which is shown by DIRECTORY as "Revised:" or in DUMP/HEADER as "Revision date:", just use:

 

$ set file/attr=moddate="time_spec" file_spec