5151extern unsigned long bpi ; /* tape density in bits per inch */
5252extern unsigned long count ; /* count of tape frames written */
5353extern int simh ; /* NZ to support SIMH tape images */
54+ int old_header = 0 ; /* NZ to limit file header to six words */
5455
5556static void usage (), itsname (), extitsname (), changedir ();
5657static 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() */
311312void 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 */
@@ -597,6 +604,7 @@ switches:\n\
597604 -f HOST:DEV use \"rmt\" remote tape server\n\
598605 -v verify (display) names of all files accessed\n\
599606 -E use E-11 tape image format\n\
607+ -O write old format tape (6 file header words)\n\
600608\n" );
601609
602610/* need some way to differentiate rmt protocol from my own weird one,
0 commit comments