DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ C T

⟦e03da2105⟧ TextFile

    Length: 2360 (0x938)
    Types: TextFile
    Names: »CVT_EXE_TO_BACKUP_C«

Derivation

└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦5d656759a⟧ 
            └─⟦this⟧ 
└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦8e9e227a9⟧ 
            └─⟦this⟧ 

TextFile

#include <stdio.h>

#include <rms.h>
#include <ssdef.h>

extern long SYS$OPEN();
extern long SYS$CREATE();
extern long SYS$CONNECT();
extern long SYS$CLOSE();
extern long SYS$GET();
extern long SYS$PUT();

int main( argc, argv )
     int	  argc;
     char	**argv;
{
    char	buffer[32256];
    int		i;

    long	status;
    struct FAB	exe_fab    = cc$rms_fab;
    struct FAB	backup_fab = cc$rms_fab;
    struct RAB	exe_rab    = cc$rms_rab;
    struct RAB	backup_rab = cc$rms_rab;

    exe_fab   .fab$l_fna = "rxi-backup.exe";
    backup_fab.fab$l_fna = "rxi-backup.bck";
    exe_fab   .fab$b_fns = strlen(exe_fab   .fab$l_fna);
    backup_fab.fab$b_fns = strlen(backup_fab.fab$l_fna);
    exe_fab   .fab$b_fac = FAB$M_GET;
    backup_fab.fab$b_fac = FAB$M_PUT;
    backup_fab.fab$b_rfm = FAB$C_FIX;
    backup_fab.fab$w_mrs = 32256;

    exe_rab   .rab$l_fab = &exe_fab;
    backup_rab.rab$l_fab = &backup_fab;

    status = SYS$OPEN( &exe_fab, NULL, NULL );
    if (status != RMS$_SUC) {
	fprintf( stderr, "RMS $OPEN failure for exe file.\n" );
	exit( status );
    }

    status = SYS$CREATE( &backup_fab, NULL, NULL );
    if (status != RMS$_SUC) {
	fprintf( stderr, "RMS $OPEN failure for backup file.\n" );
	exit( status );
    }

    status = SYS$CONNECT( &exe_rab, NULL, NULL );
    if (status != RMS$_SUC) {
	fprintf( stderr, "RMS $CONNECT failure for exe file.\n" );
	exit( status );
    }

    status = SYS$CONNECT( &backup_rab, NULL, NULL );
    if (status != RMS$_SUC) {
	fprintf( stderr, "RMS $CONNECT failure for backup file.\n" );
	exit( status );
    }

    fprintf( stderr, "Files open; " );
    for (;;) {
	for (i = 0; i < 32256; i += 512) {
	    exe_rab.rab$l_ubf = &buffer[i];
	    exe_rab.rab$w_usz = 512;
	    status = SYS$GET( &exe_rab, NULL, NULL );
	    if (status != RMS$_SUC) {
		if (status == RMS$_EOF) { break; }
		fprintf( stderr, "RMS $GET failure for exe file.\n" );
		exit( status );
	    }
	}
	if (status == RMS$_EOF) { break; }
	backup_rab.rab$l_rbf = &buffer[0];
	backup_rab.rab$w_rsz = 32256;
	status = SYS$PUT( &backup_rab, NULL, NULL );
	if (status != RMS$_SUC) {
	    fprintf( stderr, "RMS $PUT failure for backup file.\n" );
	    exit( status );
	}
	fprintf( stderr, "#" );
    }
    fprintf( stderr, "\n" );

    (void)SYS$CLOSE( &exe_fab, NULL, NULL );
    (void)SYS$CLOSE( &backup_fab,    NULL, NULL );

} /* main */