Skip to content

Commit

Permalink
Add -O option to write old tapes with six file header words.
Browse files Browse the repository at this point in the history
SALV 9 from 1973 does not accept seven words.
  • Loading branch information
larsbrinkhoff committed Sep 17, 2019
1 parent b156762 commit 94badd4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions itstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ extern unsigned long count; /* count of tape frames written */
extern int simh; /* NZ to support SIMH tape images */
int seven_track = 0; /* NZ to write 7-track tape images */
int big_endian = 0; /* NZ to read big endian record length */
int old_header = 0; /* NZ to limit file header to six words */

static void usage(), itsname(), extitsname(), changedir();
static void addfiles(), addfile(), listfiles(), listfile(),
Expand Down Expand Up @@ -318,9 +319,12 @@ static void addfile(int argc,char **argv,char *f)
/* output buffer must have been initialized with resetbuf() */
void save(char *f)
{
long len = 7;
if(verify) printf("%s => %s;%s %s ",f,ufd,fn1,fn2);

outword(-7L,0L); /* 1: AOBJN ptr giving length */
if (old_header)
len = 6;
outword(-len,0L); /* 1: AOBJN ptr giving length */
outsix(ufd); /* 2: UFD */
outsix(fn1); /* 3: filename 1 */
outsix(fn2); /* 4: filename 2 */
Expand All @@ -335,12 +339,15 @@ void save(char *f)
/* left of it are unused in UFD entries so hopefully it's safe to */
/* grab them */
/* tm_year and UFD year field are both YEAR-1900 */
outword((((unsigned long)cdate.tm_year)<<9L)|
(((unsigned long)cdate.tm_mon+1L)<<5L)|
(unsigned long)cdate.tm_mday,
((((unsigned long)cdate.tm_hour*60L)+
(unsigned long)cdate.tm_min)*60L+
(unsigned long)cdate.tm_sec)*2L); /* 7: date of last ref */
if (len >= 7) {
outword((((unsigned long)cdate.tm_year)<<9L)|
(((unsigned long)cdate.tm_mon+1L)<<5L)|
(unsigned long)cdate.tm_mday,
((((unsigned long)cdate.tm_hour*60L)+
(unsigned long)cdate.tm_min)*60L+
(unsigned long)cdate.tm_sec)*2L);
/* 7: date of last ref */
}
/* tapeflush(); */ /* finish off label record */

if(islink) { /* it's a link, not a file */
Expand Down Expand Up @@ -605,6 +612,7 @@ switches:\n\
-f HOST:DEV use \"rmt\" remote tape server\n\
-v verify (display) names of all files accessed\n\
-E use E-11 tape image format\n\
-O write old format tape (6 file header words)\n\
\n");

/* need some way to differentiate rmt protocol from my own weird one,
Expand Down

0 comments on commit 94badd4

Please sign in to comment.