- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Modify backup date and time of file attribute on D...
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
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
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
08-25-2014 07:47 AM - edited 08-25-2014 07:53 AM
08-25-2014 07:47 AM - edited 08-25-2014 07:53 AM
Modify backup date and time of file attribute on DEACCESS, not revision date and time and version.
Hi,
I want to modify the backup date and time (i.e. ATR$C_BAKDATE) of the file attribute on the DEACCESS but don’t want the revision date and time and version be modified (i.e. ATR$C_REVDATE). Please let me know how to do it.
Also is the modify on DEACCESS requires FIB$M_WRITE ?
I am trying like below
qio_bdt[] = { { 8, ATR$C_BAKDATE, bdt}, // Backup Date
{0, 0, 0}
};
stat = sys$qio(0, /* Event flag */
chan, /* Channel number */
IO$_DEACCESS, /* I/O function */
0, /* NO iosb */
0, 0, 0, /* P1 buffer */
0, /* P2 buffer length */
0, 0, qio_bdt, 0);
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 08:18 AM
08-25-2014 08:18 AM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
To me it looks like "set file/attribute" can do the job:
$ copy nl: x.x $ pipe dir/full x.x; |search sys$pipe "File ID:","Revised:","Backup:" X.X;1 File ID: (145555,22,0) Revised: 25-AUG-2014 11:00:49.05 (1) Backup: <No backup recorded> $ set file/attr=bakdate="25-AUG-2014 11:02:02.02" x.x $ pipe dir/full x.x; |search sys$pipe "File ID:","Revised:","Backup:" X.X;1 File ID: (145555,22,0) Revised: 25-AUG-2014 11:00:49.05 (1) Backup: 25-AUG-2014 11:02:02.02 $ $ copy nla0: myods5:x.x $ pipe dir/full myods5:x.x; |search sys$pipe "File ID:","Revised:","Backup:" x.x;2 File ID: (25322,33,0) Revised: 25-AUG-2014 11:04:22.85 (1) Backup: <No backup recorded> $ set file/attr=bakdate="25-AUG-2014 11:05:05.05" myods5:x.x $ pipe dir/full myods5:x.x; |search sys$pipe "File ID:","Revised:","Backup:" x.x;2 File ID: (25322,33,0) Revised: 25-AUG-2014 11:04:22.85 (1) Backup: 25-AUG-2014 11:05:05.05 $
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 09:05 AM
08-25-2014 09:05 AM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
Thanks for the response.
Yes, "set file/attribute" will definetly work.
Here I would like to do it through an application (i.e. using sys$qio call with IO$_DEACCESS ).
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 02:34 PM
08-25-2014 02:34 PM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
Are you looking for FIB$M_NORECORD (and/or fib$v_norecord)?
See Info-ZIP UnZip [.vms]vms.c:stamp_file() for some sample code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 04:53 AM
08-26-2014 04:53 AM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
Thank you.
I have pasted sample code. Please let me know what are the changes I need to do so that revision number will not be changed when the backup time is changed.
Revised: 26-AUG-2014 16:48:24.27 (3)
Thanks.
#include <descrip.h>
#include <rms.h>
#include <stdio.h>
#include <iodef.h>
#include <string.h>
#include <starlet.h>
#include <atrdef.h>
#include <fibdef.h>
#include <stsdef.h>
#define FAT$K_LENGTH 32
#define FAT$C_LENGTH 32
#define FAT$S_FATDEF 32
struct fjndef {
unsigned fjn$v_only_ru : 1;
unsigned fjn$v_rujnl : 1;
unsigned fjn$v_bijnl : 1;
unsigned fjn$v_aijnl : 1;
unsigned fjn$v_atjnl : 1;
unsigned fjn$v_never_ru : 1;
unsigned fjn$v_journal_file:1;
} ;
struct fatdef {
union {
unsigned char fat$b_rtype;
struct {
unsigned fat$v_rtype : 4;
unsigned fat$v_fileorg : 4;
} fat$r_rtype_bits;
} fat$r_rtype_overlay;
# define FAT$S_RTYPE 4
# define FAT$V_RTYPE 0
# define FAT$C_UNDEFINED 0
# define FAT$C_FIXED 1
# define FAT$C_VARIABLE 2
# define FAT$C_VFC 3
# define FAT$C_STREAM 4
# define FAT$C_STREAMLF 5
# define FAT$C_STREAMCR 6
# define FAT$S_FILEORG 4
# define FAT$V_FILEORG 4
# define FAT$C_SEQUENTIAL 0
# define FAT$C_RELATIVE 1
# define FAT$C_INDEXED 2
# define FAT$C_DIRECT 3
union {
unsigned char fat$b_rattrib;
struct {
unsigned fat$v_fortrancc : 1;
unsigned fat$v_impliedcc : 1;
unsigned fat$v_printcc : 1;
unsigned fat$v_nospan : 1;
} fat$r_rattrib_bits;
} fat$r_rattrib_overlay;
# define FAT$V_FORTRANCC 0
# define FAT$M_FORTRANCC 1
# define FAT$V_IMPLIEDCC 1
# define FAT$M_IMPLIEDCC 2
# define FAT$V_PRINTCC 2
# define FAT$M_PRINTCC 4
# define FAT$V_NOSPAN 3
# define FAT$M_NOSPAN 8
unsigned short int fat$w_rsize;
union
{
unsigned long int fat$l_hiblk;
struct
{
unsigned short int fat$w_hiblkh;
unsigned short int fat$w_hiblkl;
} fat$r_hiblk_fields;
} fat$r_hiblk_overlay;
union
{
unsigned long int fat$l_efblk;
struct
{
unsigned short int fat$w_efblkh;
unsigned short int fat$w_efblkl;
} fat$r_efblk_fields;
} fat$r_efblk_overlay;
unsigned short int fat$w_ffbyte;
unsigned char fat$b_bktsize;
unsigned char fat$b_vfcsize;
unsigned short int fat$w_maxrec;
unsigned short int fat$w_defext;
unsigned short int fat$w_gbc;
char fat$fill[8];
unsigned short int fat$w_versions;
};
struct fchdef {
unsigned : 1;
unsigned fch$v_nobackup : 1 ;
unsigned fch$v_writeback : 1;
unsigned fch$v_readcheck : 1;
unsigned fch$v_writcheck : 1;
unsigned fch$v_contigb : 1;
unsigned fch$v_locked : 1;
unsigned fch$v_contig : 1;
unsigned : 3;
unsigned fch$v_badacl : 1;
unsigned fch$v_spool : 1;
unsigned fch$v_directory : 1;
unsigned fch$v_badblock : 1;
unsigned fch$v_markdel : 1;
unsigned fch$v_nocharge : 1;
unsigned fch$v_erase : 1;
};
int start_of_backup[2];
struct {
unsigned int buff1, buff2;
}time_value;
int getfile( char * filename, int action )
{
static struct FAB fab;
static struct NAM nam;
static struct fibdef Fib;
static struct dsc$descriptor FibDesc =
{sizeof(Fib),DSC$K_DTYPE_Z,DSC$K_CLASS_S,(char *)&Fib};
static struct dsc$descriptor_s DevDesc =
{0,DSC$K_DTYPE_T,DSC$K_CLASS_S,&nam.nam$t_dvi[1]};
static struct fatdef Fat;
static union {
struct fchdef fch;
long int dummy;
} uchar;
static struct fjndef jnl;
static int Cdate[2],Rdate[2],Edate[2],Bdate[2];
static short int revisions;
static unsigned long uic;
static union {
unsigned short int value;
struct {
unsigned system : 4;
unsigned owner : 4;
unsigned group : 4;
unsigned world : 4;
} bits;
} prot;
static unsigned short back[8];
static int acllen;
static int pro;
static int u_char;
static int highwater;
static struct atrdef Atr[] = {
{ATR$S_RECATTR,ATR$C_RECATTR,&Fat},
{ATR$S_UCHAR,ATR$C_UCHAR,&uchar},
{6, ATR$C_BACKLINK, back},
{ATR$S_CREDATE,ATR$C_CREDATE,&Cdate[0]},
{ATR$S_REVDATE,ATR$C_REVDATE,&Rdate[0]},
{ATR$S_EXPDATE,ATR$C_EXPDATE,&Edate[0]},
{ATR$S_BAKDATE,ATR$C_BAKDATE,&Bdate[0]},
{ATR$S_ASCDATES,ATR$C_ASCDATES,&revisions},
{ATR$S_FPRO,ATR$C_FPRO,&prot},
{ATR$S_UIC,ATR$C_UIC,&uic},
{ATR$S_JOURNAL,ATR$C_JOURNAL,&jnl},
{4, ATR$C_ACLLENGTH, &acllen},
{2, ATR$C_FPRO, &pro},
{4, ATR$C_UCHAR, &u_char},
{4, ATR$C_HIGHWATER, &highwater},
{0,0,0}
} ;
int stat = 0;
char timestr[23];
$DESCRIPTOR(atimenow, timestr);
static char EName[NAM$C_MAXRSS];
static char RName[NAM$C_MAXRSS];
static struct dsc$descriptor_s FileName =
{0,DSC$K_DTYPE_T,DSC$K_CLASS_S,0};
static struct dsc$descriptor_s string = {0,DSC$K_DTYPE_T,DSC$K_CLASS_S,0};
static short int DevChan;
static short int iosb[4];
static long int i,status;
static int old_rtype=FAT$C_FIXED;
fab = cc$rms_fab;
fab.fab$l_fna = filename;
fab.fab$b_fns = strlen(filename);
fab.fab$l_nam = &nam;
nam = cc$rms_nam;
nam.nam$l_esa = EName;
nam.nam$b_ess = sizeof(EName);
nam.nam$l_rsa = RName;
nam.nam$b_rss = sizeof(RName);
status = sys$parse(&fab);
if (!(status & 1)) return(status);
status = sys$search(&fab);
if (!(status & 1)) return(status);
DevDesc.dsc$w_length = nam.nam$t_dvi[0];
status = sys$assign(&DevDesc,&DevChan,0,0);
if (!(status & 1)) return(status);
FileName.dsc$a_pointer = nam.nam$l_name;
FileName.dsc$w_length = nam.nam$b_name+nam.nam$b_type+nam.nam$b_ver;
for (i=0;i<3;i++)
#ifdef VAXC
Fib.fib$r_fid_overlay.fib$w_fid[i]=nam.nam$w_fid[i];
#else
Fib.fib$w_fid[i]=nam.nam$w_fid[i];
#endif
for (i=0;i<3;i++)
#ifdef VAXC
Fib.fib$r_did_overlay.fib$w_did[i]=nam.nam$w_did[i];
#else
Fib.fib$w_did[i]=nam.nam$w_did[i];
#endif
Fib.fib$l_acctl |= FIB$M_WRITE;
status = sys$qiow(0,DevChan,IO$_ACCESS| IO$M_ACCESS,&iosb,0,0,&FibDesc,&FileName,0,0,&Atr,0);
sys$gettim (start_of_backup);
/* Convert binary time to ASCII */
status = SYS$ASCTIM(0, /* timlen - Length of ASCII string */
&atimenow, /* timbuf - ASCII time buffer */
&start_of_backup, /* timadr - Binary time */
0); /* cvtflags - Conversion indicator */
struct {
short len, param;
int *ptr;
} qio_bdt[] = { { 8, ATR$C_BAKDATE, start_of_backup}, // BackUP Date
{ 0, 0, 0}
};
status = sys$qiow(0, /* Event flag */
DevChan, /* Channel number */
IO$_DEACCESS, /* I/O function */
0, /* NO iosb */
0, 0, 0, /* P1 buffer */
0, /* P2 buffer length */
0, 0, qio_bdt, 0);
return(status);
}
int main (int argc, char *argv[] )
{
if ( argc > 1 )
getfile( argv[1], 1);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 06:55 AM
08-26-2014 06:55 AM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
> See Info-ZIP UnZip [.vms]vms.c:stamp_file() for some sample code.
> I have pasted sample code. Please let me know what are the changes I
> need to do [...]
Could you not find the UnZip source?
I haven't looked at your code much more closely than you looked at
the UnZip code, but my first guess would be something like:
Fib.fib$l_acctl |= FIB$M_NORECORD;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 07:01 AM
08-26-2014 07:01 AM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
Thank you.
Sorry I forgot to mention that with
Fib.fib$l_acctl |= FIB$M_NORECORD; backup date cann't be modified.
Needs
Fib.fib$l_acctl |= FIB$M_WRITE ;
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 07:16 AM
08-26-2014 07:16 AM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
> Sorry I forgot to mention that with
>
> Fib.fib$l_acctl |= FIB$M_NORECORD; backup date cann't be modified.
>
> Needs
>
> Fib.fib$l_acctl |= FIB$M_WRITE ;
What stops you from setting both bits?
> Fib.fib$l_acctl |= FIB$M_NORECORD;
Did I say that this suggestion _replaces_ your statement which sets
FIB$M_WRITE? (No, I did not.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 07:24 AM
08-26-2014 07:24 AM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
By setting both bits I didn't get the desiared result.
Revision date and revision number are changed by setting both bits.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 02:42 PM
08-26-2014 02:42 PM
Re: Modify backup date and time of file attribute on DEACCESS, not revision date and time and versi
FWIW...
I'd suggest migrating to fatdef.h, fchdef.h, fjndef.h and related definitions, as those are available in sys$share:sys$lib_c.tlb, and removing the local definitions.
The embedded structures and constants might be entirely correct, or there might also be some potentially subtle errors, such as missing padding directives.
To reference these specified include files, use the following command:
$ CC X.C+SYS$LIBRARY:SYS$LIB_C.TLB/LIBRARY
The code is not checking the status returned from the $qiow, nor from some of the other calls, nor is the IOSB being checked, and those can sometimes provide clues to the problem.
Probably obvious: there is a latent buffer overrun within the filename handling code, and a latent ODS-2 assumption.