Chaosnet / chaosnet-tools

Tools for Chaosnet
http://chaosnet.net/
3 stars 1 forks source link

rtape: is "drive" the best way to construct the sim. tape filename? #15

Open Bikeman opened 6 months ago

Bikeman commented 6 months ago

I used ITS :DUMP to test rtape and I wonder about the "fidelity" and "practicality" of the mapping of RTAPE requests to simulated tape files (especially in wrt to the "database" maintained by ITS that tracks which files were written to which tapes):

This is my current understanding, please correct me if I'm wrong (I guess some of the following points must be wrong as there was some guessing involved). Based mainly on https://github.com/PDP-10/its/blob/master/doc/info/dump.info and https://gunkies.org/wiki/Chaos_RTAPE_protocol

So if all this is true, than in order to be able to use the feature that ITS :DUMP keeps track of which tape no files were written to, wouldn't it be better to include the fileno (is this the "reel" field in the RTAPE protocol???) to construct a filename for storage by rtape. .E.g. if ITS'S :DUMP _list would tell me that file can be found on tape 4077 , I would then that file nr when reading the file back with :DUMP and rtape could pick the correct file which could be named, say, somedrive.tapeno.tape

Hope this makes some sense. So long story short: I'd suggest (and volunteer to do) to optionlly (via command line switch) include the "reel" field in the mount request to the filename that is used to pick the filename used to store the simulated tape.

bictorv commented 6 months ago

I sympathize with the issue of tape filenames. I'd like to (1) have a ".tap" file type, (2) be able to separate tape files from different remote hosts either by filename (e.g. "drive.hostname.tap") or even directories (put all tapes for a host in a subdir "host/"). But (2) should be elective, since it would make it harder to share tapes between hosts (you'd need to e.g. make links).

If you check the (non-quiet) output from rtape (or read the DUMP sources after the OPEN1 label), you can see the "reel" provided by DUMP is the string "ITS". So to incorporate the "tape no", you need to change DUMP, not rtape.

Changing what is logged in MACRO TAPES (e.g. what remote host and drive) might be more work and involve backwards compatibility?

larsbrinkhoff commented 6 months ago

The tape number is used by ITS to keep track of tapes. There is a database that says which tape number has which files. I don't know if DUMP sends this number in the RTAPE request; does it?

Sometimes you'll see the word reel. I'm not sure but my vague understanding is that a "logical backup tape" may consist of several "physical tapes" and then the latter are reels.

I'm prone to avoid complexity. Having the user type the file name is very simple and direct. The user should probably name a backup tape number 1234 something like "tape_1234.tap". My auto backup program does this.

larsbrinkhoff commented 6 months ago

I'd rather not change DUMP with respect to RTAPE information or MACRO TAPES.

Bikeman commented 6 months ago

you can see the "reel" provided by DUMP is the string "ITS".

Upps...that sinks my idea pretty much. Not sure how the "removable media" aspect of tapes was handled in the vintage world over RTAPE then, but that's the way it is (was).

Changing DUMP is definitely not my intention!!

Still more flexibility with the filename might be useful. I wonder if, as a minimalist solution, one should be able to specify an optional printf-format string on the rtape commandline that would be used to build the filename like sprintf(tapename_buf,len,tapename_fmt,host,drive,reel) and the default would simply be "%.0s%s%.0s" which would be equivalent to "just the drive name" and e.g. "%.0s%s%.0s.tap" would add a ".tap" extension...etc. Checks/sanitizing for forbidden characters would then need to be done on all strings that contribute to the filename and sent by the clients, of course.

larsbrinkhoff commented 6 months ago

Sure, such a feature could be added, activated by an option.

The default can be to use the "drive name" verbatim, where the user gets what they type; no more and no less. That's very transparent.