Hi Colin,
>This is in fact extremely easy: you just fopen("/PREFIX/FILENAME") and
>it finds the correct drive all by itself :)
Yes, ProDOS is about volumes and paths, not about slots and drives.
However, if you have to access a certain drive then the way to do it
is this:
1. Calculate the device number according to the formula
device = slot + (drive - 1) * 8
(
https://cc65.github.io/doc/apple2.html#ss9)
2. Call getdevicedir() with the device from 1.
(
https://cc65.github.io/doc/funcref.html#ss3.135)
3. Construct an absolute path from 2. or call chdir() with 2.
If you want to return where you've been before calling chdir(), you
can call getcwd() before chdir().
In general, you might want to have a look at
https://github.com/cc65/cc65/blob/master/samples/enumdevdir.c
Regards,
Oliver