- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Change/Modify VMS file creation date
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 02:44 AM
тАО01-29-2004 02:44 AM
I didn't see anything that looked like it would do it from set file.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 03:12 AM
тАО01-29-2004 03:12 AM
SolutionDFU can be obtained from
http://h71000.www7.hp.com/freeware/freeware60/dfu/
or an old version from
http://h71000.www7.hp.com/freeware/freeware50/dfu027a/
why do you want to do this?
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 03:28 AM
тАО01-29-2004 03:28 AM
Re: Change/Modify VMS file creation date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 03:31 AM
тАО01-29-2004 03:31 AM
Re: Change/Modify VMS file creation date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 03:33 AM
тАО01-29-2004 03:33 AM
Re: Change/Modify VMS file creation date
perahps you need COPY/SINCE=
The /MODIF operator tell to VMS check modify date instead default created date.
Bye
Antoniov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 03:35 AM
тАО01-29-2004 03:35 AM
Re: Change/Modify VMS file creation date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 03:39 AM
тАО01-29-2004 03:39 AM
Re: Change/Modify VMS file creation date
Now, if you are REALLY REALLY GUTSY it is possible to cheat like heck by opening the index file with DCL, finding the file header, locating and updating the file date info, and recomputing the checksum for that header, then write back the block. But that is only for true masochists.
I do NOT suggest that you take it to that extreme. I have done it once in a true emergency and hope to never again need to do this. You would do better to write yourself a little utility program in BASIC, FORTRAN, or something else convenient to your site, make it use a logical name for the file name and another one for the desired date, and then just stuff the date in the XAB for the file you selected. Then you could write a little DCL script to drive it through the files you wanted to update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 03:43 AM
тАО01-29-2004 03:43 AM
Re: Change/Modify VMS file creation date
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 05:08 AM
тАО01-29-2004 05:08 AM
Re: Change/Modify VMS file creation date
since you already mention FILE I do recommend it once more. It is the Swiss army knife for file attributes, easy to use and I never ever had a problem with it.
File can be found at
http://vms.process.com/scripts/fileserv/fileserv_search.exe?package=file&description=&author=meadows&system=Either&language=All
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 08:28 AM
тАО01-29-2004 08:28 AM
Re: Change/Modify VMS file creation date
If somehow you can not get that going rightaway, and you have this problem to deal with, then you could consider the little program I wrote a while back. It displays the current CDT and sets to the provided argument. I'll include it below as well as attach it as text file.
hth,
Hein.
#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);
if (argc < 3) return 24;
fab.fab$l_fna = argv[1];
fab.fab$b_fns = strlen(fab.fab$l_fna);
fab.fab$b_shr = FAB$M_UPI;
fab.fab$b_fac = FAB$M_PUT;
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);
date_dx.dsc$a_pointer = argv[2];
date_dx.dsc$w_length = strlen (date_dx.dsc$a_pointer);
stat = SYS$BINTIM (&date_dx, &dat.xab$q_cdt);
stat = SYS$CLOSE ( &fab );
}
return stat;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 12:52 PM
тАО01-29-2004 12:52 PM
Re: Change/Modify VMS file creation date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 09:06 PM
тАО01-29-2004 09:06 PM
Re: Change/Modify VMS file creation date
That shouldn't work. The RMS reference manual
(V7.3-2) states that the close service only
processes XABPRO and XABRDT XABs.
I tried Hein's program on a V7.3-1 system and
it appears not to work. So I guess this is
something that changed, or was fixed, on
some version of OpenVMS.
Martin Kirby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2004 11:24 PM
тАО01-29-2004 11:24 PM
Re: Change/Modify VMS file creation date
For some reason I can't get Hein's example to work; all the file's dates remain the same after running it, and I even stepped through it in the debugger to make sure the return values that aren't being checked were successful.
I"ve attached and included an example with the same interface as Hein's but with a completely different approach, based on the work of other people as the comments indicate.
----- zapcdt.c -----
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
struct vmsdate {
long int low;
long int high;
};
extern int main(int, char **);
int set_cdt(char *, struct vmsdate *);
int main(argc, argv)
int argc;
char *argv[];
{
static char date_string[NAM$C_MAXRSS+1];
$DESCRIPTOR(date_string_dsc, date_string);
struct vmsdate bintime;
unsigned int retsts;
/*
* If there aren't any parameters, tell the user how it's done and
* exit.
*/
if (argc < 2) {
fprintf(stderr, "Usage: %s filespec [vms_date_time]\n", argv[0]);
exit(CLI$_NULFIL);
}
/*
* If there is a second parameter, assume it is a VMS date/time string and
* parse it into a 64-bit binary date/time.
*/
if (argc > 2) {
strncpy(date_string, argv[2], sizeof(date_string));
date_string_dsc.dsc$w_length = strlen(date_string);
retsts = sys$bintim(&date_string_dsc, &bintime);
if (!(retsts & 1)) {
exit(retsts);
}
retsts = set_cdt( argv[1], &bintime );
}
else {
retsts = set_cdt( argv[1], NULL ); /* let it fill in current time */
}
exit(retsts);
}
/* set_cdt -- set the creation time and the revision time of a file
* This is based on Charles Bailey's my_utime from the Perl 5 distribution,
* except it changes the creation time as well as the revision time and has
* simpler error handling (no exception handlers).
*/
/* from the original comments in Perl's VMS.C: */
/* my_utime - update modification time of a file
* Code here is based on Joe Meadows' FILE utility.
*/
int set_cdt(char *file, struct vmsdate *date_time)
{
register int i;
static struct vmsdate bintime;
unsigned long int chan, retsts;
struct io_stat_blk { /* I/O status block */
short int completion_status;
short int msg_len;
int device_specific_info;
} iosb;
char vmsspec[NAM$C_MAXRSS+1], rsa[NAM$C_MAXRSS], esa[NAM$C_MAXRSS];
struct FAB myfab = cc$rms_fab;
struct NAM mynam = cc$rms_nam;
#if defined (__DECC) && defined (__VAX)
/* VAX DEC C atrdef.h has unsigned type for pointer member atr$l_addr,
* at least through VMS V6.1, which causes a type-conversion warning.
*/
# pragma message save
# pragma message disable cvtdiftypes
#endif
struct atrdef myatr[3] = {{sizeof bintime, ATR$C_CREDATE, &bintime},
{sizeof bintime, ATR$C_REVDATE, &bintime},
{0,0,0}};
static struct fibdef myfib;
#if defined (__DECC) && defined (__VAX)
/* This should be right after the declaration of myatr, but due
* to a bug in VAX DEC C, this takes effect a statement early.
*/
# pragma message restore
#endif
struct dsc$descriptor fibdsc = {sizeof(myfib), DSC$K_DTYPE_Z, DSC$K_CLASS_S,(char *) &myfib},
devdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0},
fnmdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0};
if (file == NULL || *file == '\0') {
return LIB$_INVARG;
}
strncpy(vmsspec, file, sizeof(vmsspec));
if (date_time != NULL) {
bintime.low = date_time->low;
bintime.high = date_time->high;
}
else {
/* Just get the current time in VMS format directly */
retsts = sys$gettim(&bintime);
if (!(retsts & 1)) {
return retsts;
}
}
myfab.fab$l_fna = vmsspec;
myfab.fab$b_fns = (unsigned char) strlen(vmsspec);
myfab.fab$l_nam = &mynam;
mynam.nam$l_esa = esa;
mynam.nam$b_ess = (unsigned char) sizeof esa;
mynam.nam$l_rsa = rsa;
mynam.nam$b_rss = (unsigned char) sizeof rsa;
/* Look for the file to be affected, letting RMS parse the file
* specification for us as well.
*/
retsts = sys$parse(&myfab,0,0);
if (!(retsts & 1)) {
return retsts;
}
retsts = sys$search(&myfab,0,0);
if (!(retsts & 1)) {
return retsts;
}
devdsc.dsc$w_length = mynam.nam$b_dev;
devdsc.dsc$a_pointer = (char *) mynam.nam$l_dev;
retsts = sys$assign(&devdsc,&chan,0,0);
if (!(retsts & 1)) {
return retsts;
}
fnmdsc.dsc$a_pointer = mynam.nam$l_name;
fnmdsc.dsc$w_length = mynam.nam$b_name + mynam.nam$b_type + mynam.nam$b_ver;
memset((void *) &myfib, 0, sizeof myfib);
#ifdef __DECC
for (i=0;i<3;i++) myfib.fib$w_fid[i] = mynam.nam$w_fid[i];
for (i=0;i<3;i++) myfib.fib$w_did[i] = mynam.nam$w_did[i];
/* This prevents the revision time of the file being reset to the current
* time as a result of our IO$_MODIFY $QIO. */
myfib.fib$l_acctl = FIB$M_NORECORD;
#else
for (i=0;i<3;i++) myfib.fib$r_fid_overlay.fib$w_fid[i] = mynam.nam$w_fid[i];
for (i=0;i<3;i++) myfib.fib$r_did_overlay.fib$w_did[i] = mynam.nam$w_did[i];
myfib.fib$r_acctl_overlay.fib$l_acctl = FIB$M_NORECORD;
#endif
retsts = sys$qiow(0,chan,IO$_MODIFY,&iosb,0,0,&fibdsc,&fnmdsc,0,0,myatr,0);
if (retsts & 1) retsts = iosb.completion_status;
if (!(retsts & 1)) {
return retsts;
}
return SS$_NORMAL;
} /* end of set_cdt() */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
struct vmsdate {
long int low;
long int high;
};
extern int main(int, char **);
int set_cdt(char *, struct vmsdate *);
int main(argc, argv)
int argc;
char *argv[];
{
static char date_string[NAM$C_MAXRSS+1];
$DESCRIPTOR(date_string_dsc, date_string);
struct vmsdate bintime;
unsigned int retsts;
/*
* If there aren't any parameters, tell the user how it's done and
* exit.
*/
if (argc < 2) {
fprintf(stderr, "Usage: %s filespec [vms_date_time]\n", argv[0]);
exit(CLI$_NULFIL);
}
/*
* If there is a second parameter, assume it is a VMS date/time string and
* parse it into a 64-bit binary date/time.
*/
if (argc > 2) {
strncpy(date_string, argv[2], sizeof(date_string));
date_string_dsc.dsc$w_length = strlen(date_string);
retsts = sys$bintim(&date_string_dsc, &bintime);
if (!(retsts & 1)) {
exit(retsts);
}
retsts = set_cdt( argv[1], &bintime );
}
else {
retsts = set_cdt( argv[1], NULL ); /* let it fill in current time */
}
exit(retsts);
}
/* set_cdt -- set the creation time and the revision time of a file
* This is based on Charles Bailey's my_utime from the Perl 5 distribution,
* except it changes the creation time as well as the revision time and has
* simpler error handling (no exception handlers).
*/
/* from the original comments in Perl's VMS.C: */
/* my_utime - update modification time of a file
* Code here is based on Joe Meadows' FILE utility.
*/
int set_cdt(char *file, struct vmsdate *date_time)
{
register int i;
static struct vmsdate bintime;
unsigned long int chan, retsts;
struct io_stat_blk { /* I/O status block */
short int completion_status;
short int msg_len;
int device_specific_info;
} iosb;
char vmsspec[NAM$C_MAXRSS+1], rsa[NAM$C_MAXRSS], esa[NAM$C_MAXRSS];
struct FAB myfab = cc$rms_fab;
struct NAM mynam = cc$rms_nam;
#if defined (__DECC) && defined (__VAX)
/* VAX DEC C atrdef.h has unsigned type for pointer member atr$l_addr,
* at least through VMS V6.1, which causes a type-conversion warning.
*/
# pragma message save
# pragma message disable cvtdiftypes
#endif
struct atrdef myatr[3] = {{sizeof bintime, ATR$C_CREDATE, &bintime},
{sizeof bintime, ATR$C_REVDATE, &bintime},
{0,0,0}};
static struct fibdef myfib;
#if defined (__DECC) && defined (__VAX)
/* This should be right after the declaration of myatr, but due
* to a bug in VAX DEC C, this takes effect a statement early.
*/
# pragma message restore
#endif
struct dsc$descriptor fibdsc = {sizeof(myfib), DSC$K_DTYPE_Z, DSC$K_CLASS_S,(char *) &myfib},
devdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0},
fnmdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0};
if (file == NULL || *file == '\0') {
return LIB$_INVARG;
}
strncpy(vmsspec, file, sizeof(vmsspec));
if (date_time != NULL) {
bintime.low = date_time->low;
bintime.high = date_time->high;
}
else {
/* Just get the current time in VMS format directly */
retsts = sys$gettim(&bintime);
if (!(retsts & 1)) {
return retsts;
}
}
myfab.fab$l_fna = vmsspec;
myfab.fab$b_fns = (unsigned char) strlen(vmsspec);
myfab.fab$l_nam = &mynam;
mynam.nam$l_esa = esa;
mynam.nam$b_ess = (unsigned char) sizeof esa;
mynam.nam$l_rsa = rsa;
mynam.nam$b_rss = (unsigned char) sizeof rsa;
/* Look for the file to be affected, letting RMS parse the file
* specification for us as well.
*/
retsts = sys$parse(&myfab,0,0);
if (!(retsts & 1)) {
return retsts;
}
retsts = sys$search(&myfab,0,0);
if (!(retsts & 1)) {
return retsts;
}
devdsc.dsc$w_length = mynam.nam$b_dev;
devdsc.dsc$a_pointer = (char *) mynam.nam$l_dev;
retsts = sys$assign(&devdsc,&chan,0,0);
if (!(retsts & 1)) {
return retsts;
}
fnmdsc.dsc$a_pointer = mynam.nam$l_name;
fnmdsc.dsc$w_length = mynam.nam$b_name + mynam.nam$b_type + mynam.nam$b_ver;
memset((void *) &myfib, 0, sizeof myfib);
#ifdef __DECC
for (i=0;i<3;i++) myfib.fib$w_fid[i] = mynam.nam$w_fid[i];
for (i=0;i<3;i++) myfib.fib$w_did[i] = mynam.nam$w_did[i];
/* This prevents the revision time of the file being reset to the current
* time as a result of our IO$_MODIFY $QIO. */
myfib.fib$l_acctl = FIB$M_NORECORD;
#else
for (i=0;i<3;i++) myfib.fib$r_fid_overlay.fib$w_fid[i] = mynam.nam$w_fid[i];
for (i=0;i<3;i++) myfib.fib$r_did_overlay.fib$w_did[i] = mynam.nam$w_did[i];
myfib.fib$r_acctl_overlay.fib$l_acctl = FIB$M_NORECORD;
#endif
retsts = sys$qiow(0,chan,IO$_MODIFY,&iosb,0,0,&fibdsc,&fnmdsc,0,0,myatr,0);
if (retsts & 1) retsts = iosb.completion_status;
if (!(retsts & 1)) {
return retsts;
}
return SS$_NORMAL;
} /* end of set_cdt() */
----- zapcdt.c -----
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2004 01:25 AM
тАО01-30-2004 01:25 AM
Re: Change/Modify VMS file creation date
Oh well...
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2004 02:12 AM
тАО01-30-2004 02:12 AM
Re: Change/Modify VMS file creation date
I couldn't help but wonder why I had this broken example. So I hit an altavista search engine over some (hp internal) notesfiles (vms-es old and improved version of forums :-). It popped up:
10 WIZARD 3223.1 (0.14) Author: HEIN@MIASYS
Date: 18-Oct-1999 14:44:03
You can use the XAB$Q_RDT field in the XABRDT as input to a $CLOSE to change the REVISION date for a write accessed file to a user ...
$DIR/DATE [.EXAMPLES]*DT.C
$ $DIR/DATE [.EXAMPLES]*DT.C
CDT.C;4 18-OCT-1999 14:04:25.00
RDT.C;3 21-JUL-1994 00:37:18.00
Ah So! Look at the date for the file and for the reply! I must have made it to support a Wizard question:
http://h71000.www7.hp.com/wizard/wiz_3223.html
Which begs the question... is there any question left that wasn't asked and answered before :-). The tricky part is to find them!
(as bonus for reading these ramblings i'll include that rdt.c ;-).
Cheers,
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
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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-23-2004 07:45 AM
тАО02-23-2004 07:45 AM
Re: Change/Modify VMS file creation date
I know this worked several versions of VMS ago, assume it still does...
PJ
Peejay
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If it can't be done with a VT220, who needs it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2004 01:37 AM
тАО03-02-2004 01:37 AM
Re: Change/Modify VMS file creation date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2004 03:59 AM
тАО03-02-2004 03:59 AM
Re: Change/Modify VMS file creation date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2004 05:30 AM
тАО03-02-2004 05:30 AM
Re: Change/Modify VMS file creation date
Sure.
Thanks for remind.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2004 06:07 AM
тАО03-02-2004 06:07 AM
Re: Change/Modify VMS file creation date
The comment wasn't directed at you - as far as I can tell you posted an URL, not source code into the text entry box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2004 11:19 AM
тАО03-02-2004 11:19 AM
Re: Change/Modify VMS file creation date
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2004 10:45 PM
тАО03-02-2004 10:45 PM