[cc65] Filenames for POSIX functins on CBM targets

From: Oliver Schmidt <ol.sc1web.de>
Date: 2012-08-09 14:20:02
Hi,

I'm not sure if this is an exceptionally bad or an exceptionally good
time to bring up that topic (coming from my cc65 todo list) so please
excuse if the former is true...

As far as I understand on CBM targets currently one can prepend a
filename to be given to open() with "0#" or "1#" to select the "drive
number" (whatever that acually is). However there's no way to select
the 'unit number' and that seems a big issue to me.

Imagine some editor asking you for the filename to to save the current
content to. In my opinion it should be possible to denote any possible
location in the string entered by the user. Or to describe it more
generally: A single string should be enough to describe the absolute
location of a file in the system.

I understand very well that the syntax of such a filename description
is specific to a certain target. I'm just arguing that it should exist
for every target. If there's already a syntax well known to users on a
certain target then it is of course desirable to re-use it. But if
there isn't one or if there are good reason to divert from it then
cc65 should define its own syntax and document it.

After having taken care of open() (and things like rename() /
remove()) the potential next step would be to allow opendir() to be
parametrized with the "unit/drive part" of the filename syntax defined
before.

And finally I'd like to at least discuss the option to implement
getcwd() and chdir() in a way that they provide/take the same
"unit/drive part" of the filename. Optionally one could then even
remove _curunit altogether.

Surely a "directory" isn't the same as a "unit number" but if I think
i.e. of Windows where chdir("C:\\") is something ordninary it isn't
far to a hypothetical CP/M chdir("A:") and from there it isn't far to
some CBM chdir("<?>8<?>").

Please note that I'm intentionally trying to not open up a discussion
on supporting IDE64 / CMD / <you name them> filename extensions for
filesystems with subdirectories. I'm just looking for a consistent way
to describe all file locations on a plain vanilla CBM DOS system.

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Aug 9 14:20:57 2012

This archive was generated by hypermail 2.1.8 : 2012-08-09 14:21:00 CEST