4 ms·
The tape wouldn't have to be provided as a single flat file. You could, for instance, use something like a pair of files, one for control and one for data:
by kps 4y ago
The tape wouldn't have to be provided as a single flat file. You could, for instance, use something like a pair of files, one for control and one for data:
fputc('L', tape_control);
c = fgetc(tape_data);
fputc(d, tape_data);
or a single file with controls disjoint from the tape symbols.
- camel-cdr 4y agoThis would be possible, but it feels like cheating :-) Idk how to express this properly, but I feel like there is a difference between this and the fseek approach. In a similar vain, you could say that a certain kind of undefined behavior controls the tape, or writing to a specific part of memory does. I suppose this would fall under adding additional compiler extension.
- kps 4y ago> … or writing to a specific part of memory does. Memory-mapped devices are pretty common. C's original platform controlled tape drives by writing to memory: https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/dev/tc.c https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/dev/tc...