tom-seddon / beeblink

A file storage system for the BBC Micro
GNU General Public License v3.0
16 stars 2 forks source link

Tools musings #67

Open tom-seddon opened 3 years ago

tom-seddon commented 3 years ago

Some kind of mechanism for BBC interop with Unix pipeline tools. Along these lines:

  1. execute * command on Beeb, passing afsp, *SHA1SUM X.*
  2. server finds matching Beeb files, collates corresponding PC file names
  3. server runs sha1sum, passing in the PC file names
  4. server collects output, sets that as the server string, and the Beeb prints it

*HELP TOOLS for a list.

Example use cases:

Also: tools that take data via stdin. Some kind of pseudo-file that you can *SPOOL to, perhaps? This would be suitable as-is for fire-and-forget tools such as pmacs. Buffer stdin input, then send it to the tool when the file is closed. One open/write/close operation = one invocation of the tool. BREAK cancels. Is it possible to distinguish terminating *SPOOL and CLOSE#0?

For attempting to approximate pipelines, maybe buffer tool output after invocation, and allow the pseudo-file to be opened to examine the result. Not sure how useful this would actually be though.

Various options. Config file needed.

(Beeblink should be able to reload the config file while running. Check mtime once per second? Or whatever. Like the USB device autodetection.)

tom-seddon commented 3 years ago

Regarding sha1sum, I forgot it prints the file name!

tmbp ~/tmp % sha1sum nops.zip
0ae585f0e92268eb95a6936d8ed72f3ef1c0ae9f  nops.zip

So you'll get the PC name for each Beeb file.

More markup? :( - maybe some regexp hell, or something, like the error mechanism in Emacs. Match each output line with regexp, then group 1 = part to replace with Beeb name, group 2 = somethingsomething (etc., etc.). Bit of a pain, but if Python-style named groups are easy to support, this could actually be quite flexible.