hackerb9 / Tandy-Terminfo

UNIX terminfo for TRS-80 Model 100 and Tandy 200 allowing screen control for TELCOM
MIT License
25 stars 2 forks source link

Saving from BASIC, and smoother file upload #6

Open dawidi opened 3 years ago

dawidi commented 3 years ago

Yet another tangentially related thing that took me hours to diagnose and understand, but is actually easy to solve...

In Model 100 BASIC, SAVE"COM:98N1E" is different in two regards from the UPLOAD feature within a TELCOM session:

Both those TTY settings shouldn't interfere with anything else, so they could be put in .bash_profile along with the others.

And I expect that any data to be exchanged with a Model 100/200 would be plain-text anyway (or if it's other data, then at least encoded in a way that avoids the ASCII 0-31 range), so all that shuffling around of control characters shouldn't impact the payload.

I ended up doing a read loop in bash, instead of just catting to the destination file, to allow me to filter out things like this. While I was at it, I also made the script wait indefinitely for the first line of incoming data, but time out after 2 seconds for all subsequent lines. Which means that (as long as you only want to upload one file per run) the upload can terminate automatically, much more elegant than having to manually end it with ^D.

Once I've thoroughly tested and polished them, would you be interested in adding that stor script and its (simpler) retr counterpart to this project? Alternatively, I guess I could start my own project for those, as well as that character conversion C program... that would make it slightly harder to find but less of a maintenance burden for you ;-)

Maybe it would also make sense to split your lengthy readme into multiple separate files and have example files (like the suggested .bash_profile settings) as a separately downloadable file?