ProDOS-8 / ProDOS8-Testing

QA and Testing for ProDOS-8 Releases
MIT License
29 stars 1 forks source link

BASIS.SYSTEM-like external command #39

Open oliverschmidt opened 4 years ago

oliverschmidt commented 4 years ago

Hi,

In https://github.com/ProDOS-8/ProDOS8-Testing/issues/36 I proposed a BASIC.SYSTEM interface to external commands. Beside the usual suspects like FORMAT, COPY, ONLINE etc. I'd see an external command that allows to open "documents" of a certain type by running the "correct" program and providing the document as startup file.

Hopefully there are synergy effects with the proposed BASIS.SYSTEM extension for Bitsy Bye. However, the external command should have a meaningful name like i.e. DRUN (for "Document Run" similar to BRUN for "Binary Run").

Apart from the general availability of such an external command I'd like to propose a specific way, how such a command (and BASIS.SYSTEM) could determine the "correct" program for a certain document type. I did that proposal already two years ago for BASIS.SYSTEM in https://groups.google.com/d/msg/comp.sys.apple2/HKF3KhkYBaM/6zZr2IZVAAAJ.

Please find the actual text of my proposal for your convenience below.

Regards, Oliver


The GS/OS 6.0 Finder uses icon files. The finder searches for icon files in a folder named 'Icons' on every mounted volume.

The major purpose of icons files is to provide a graphic representation (aka icon) for documents of a certian "type". But beside that graphic representation icon files contain the absolute path to the program to open documents of that type.

One icon file can contain the information of many document "types". A document "type" is defined by a tuple of

There are graphical editors to edit such icon files. On http://www.whatisthe2gs.apple2.org.za/icon-mania/ there's a screenshot of such an icon editor showing the dialog to edit the document type definition and program to load documents of that type - http://www.whatisthe2gs.apple2.org.za/assets/Icon-Mania/Icons02.gif

If the program given for a document type is a ProDOS 8 program and the user opens a document of that type the Finder switches to ProDOS 8 and starts the program in question using the ProDOS 8 startup file protocol to provide the document path to the program. So from my perspective it's the very functionality we're looking here to provide for ProDOS 8.

John already stated that he sees two repesentations for the file/aux-type-to-program-mapping:

  1. An internal representation being part of the BASIS.SYSTEM file optimized for quick access.
  2. An external representation in a separate file.

All this leads me to the proposal of using a GS/OS Finder icon file as this external representation. The file format is fully documented - http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.ca.xxxx

I suggest to put all mappings relevant for BASIS.SYSTEM in a single icon file with the fixed name 'Icons/ProDOS.icons'. It's not uncommon to use the plural if there are multiple icons in an icon file.

I propose a ProDOS 8 text mode program that is able to read and write this very file. The program is an interactive editor for the mappings in that file. Additionally the program allows to export the mappings to BASIS.SYSTEM.

That ProDOS 8 program doesn't care at all about the actual icon being part of each mapping created. Rather it just uses the same icon for all mappings in ProDOS.icons. That single icon is part of the program itself and identical to the GS/OS icon for ProDOS and BASIC.System, see - http://applemuseum.bott.org/sections/images/screenshots/2gs_desktop.gif

Of course the user is free to alternatively use a GS/OS based graphical icon editor to edit ProDOS.icons in just the same way he would edit other icon files. This way he could create individual icons for the mappings. Such a user would then use the ProDOS 8 text mode program only for reading ProDOS.icons and exporting the mappings to BASIS.SYSTEM.

Anyway, with this approach any mapping created for BASIS.SYSTEM would automatically be used in the very same way by the GS/OS 6.0 Finder too.

If there's a momentum to welcome this proposal I'm willing to contribute the ProDOS 8 program described. I'd create it using the cc65 C compiler.