1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-28 21:07:43 +00:00

All: Fix devices that attach files and have special meaning for -A switch

The -A attach time switch implicitly means to open files in append
mode.

Some devices used -A to indicate ASCII data or AUTOSIZE of disk or
fixed size tapes - DECtape.  These devices are either read only devices
(Paper tape readers or card readers), so explicit forcing of the attach
to be -R avoids unexpected positioning errors.  The random access
Disk and fixed sized tapes buffer the container contents in memory
so append mode isn't relevant, but care must be taken to assure that
the buffer reading starts at the beginning of the file without regard
to the explicit open mode.

As reported in #821
This commit is contained in:
Mark Pizzolato
2020-03-22 09:54:54 -07:00
parent 17a3219d0a
commit 614ad52091
11 changed files with 13 additions and 0 deletions

View File

@@ -1299,6 +1299,7 @@ else if (uptr->flags & UNIT_11FMT)
sim_printf ("16b format");
else sim_printf ("18b/36b format");
sim_printf (", buffering file in memory\n");
(void)sim_fseek (uptr->fileref, 0, SEEK_SET); /* start at the beginning of file */
uptr->io_flush = dt_flush;
if (uptr->flags & UNIT_8FMT) { /* 12b? */
for (ba = 0; ba < uptr->capac; ) { /* loop thru file */