From fc2f3675fc1b89ec4dc4e9f2853a17483e166052 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 16 May 2014 05:22:45 -0700 Subject: [PATCH] TAPES: Make sure that all activities related to TPC formatted tapes are read only. - A -R flag is forced (attach READ ONLY) when TPC formatted tapes are attached. This should avoid updating file modified timestamps by any simh simulator. - All write operations to TPC formatted tapes will fail with a write protected status. --- sim_tape.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sim_tape.c b/sim_tape.c index b1bca198..67045d27 100644 --- a/sim_tape.c +++ b/sim_tape.c @@ -442,6 +442,8 @@ if (sim_switches & SWMASK ('F')) { /* format spec? */ if (sim_tape_set_fmt (uptr, 0, gbuf, NULL) != SCPE_OK) return SCPE_ARG; } +if (MT_GET_FMT (uptr) == MTUF_F_TPC) + sim_switches |= SWMASK ('R'); /* Force ReadOnly attach for TPC tapes */ r = attach_unit (uptr, cptr); /* attach unit */ if (r != SCPE_OK) /* error? */ return r; @@ -1819,7 +1821,7 @@ return (uptr->capac && (uptr->pos >= uptr->capac))? TRUE: FALSE; t_bool sim_tape_wrp (UNIT *uptr) { -return (uptr->flags & MTUF_WRP)? TRUE: FALSE; +return ((uptr->flags & MTUF_WRP) || (MT_GET_FMT (uptr) == MTUF_F_TPC))? TRUE: FALSE; } /* Process I/O error */