Skip to content

Commit 4f41b42

Browse files
committed
Add -O option to write old tapes with six file header words.
SALV 9 from 1973 does not accept seven words.
1 parent c87e3bf commit 4f41b42

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

itstar.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
extern unsigned long bpi; /* tape density in bits per inch */
5252
extern unsigned long count; /* count of tape frames written */
5353
extern int simh; /* NZ to support SIMH tape images */
54+
int old_header; /* NZ to limit file header to six words */
5455

5556
static void usage(), itsname(), extitsname(), changedir();
5657
static void addfiles(), addfile(), listfiles(), listfile(),
@@ -310,9 +311,12 @@ static void addfile(int argc,char **argv,char *f)
310311
/* output buffer must have been initialized with resetbuf() */
311312
void save(char *f)
312313
{
314+
long len = 7;
313315
if(verify) printf("%s => %s;%s %s ",f,ufd,fn1,fn2);
314316

315-
outword(-7L,0L); /* 1: AOBJN ptr giving length */
317+
if (old_header)
318+
len = 6;
319+
outword(len,0L); /* 1: AOBJN ptr giving length */
316320
outsix(ufd); /* 2: UFD */
317321
outsix(fn1); /* 3: filename 1 */
318322
outsix(fn2); /* 4: filename 2 */
@@ -327,12 +331,15 @@ void save(char *f)
327331
/* left of it are unused in UFD entries so hopefully it's safe to */
328332
/* grab them */
329333
/* tm_year and UFD year field are both YEAR-1900 */
330-
outword((((unsigned long)cdate.tm_year)<<9L)|
331-
(((unsigned long)cdate.tm_mon+1L)<<5L)|
332-
(unsigned long)cdate.tm_mday,
333-
((((unsigned long)cdate.tm_hour*60L)+
334-
(unsigned long)cdate.tm_min)*60L+
335-
(unsigned long)cdate.tm_sec)*2L); /* 7: date of last ref */
334+
if (len >= 7) {
335+
outword((((unsigned long)cdate.tm_year)<<9L)|
336+
(((unsigned long)cdate.tm_mon+1L)<<5L)|
337+
(unsigned long)cdate.tm_mday,
338+
((((unsigned long)cdate.tm_hour*60L)+
339+
(unsigned long)cdate.tm_min)*60L+
340+
(unsigned long)cdate.tm_sec)*2L);
341+
/* 7: date of last ref */
342+
}
336343
/* tapeflush(); */ /* finish off label record */
337344

338345
if(islink) { /* it's a link, not a file */
@@ -596,6 +603,7 @@ switches:\n\
596603
-f HOST:DEV use \"rmt\" remote tape server\n\
597604
-v verify (display) names of all files accessed\n\
598605
-E use E-11 tape image format\n\
606+
-O write old format tape (6 file header words)\n\
599607
\n");
600608

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

0 commit comments

Comments
 (0)