Re: [cc65] Filenames for POSIX functins on CBM targets

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2012-08-11 21:31:18
Hello,

* On Sat, Aug 11, 2012 at 08:24:59PM +0200 Ullrich von Bassewitz wrote:
> 
> On Fri, Aug 10, 2012 at 04:24:40PM +0200, Spiro Trikaliotis wrote:
> > Also: devices 0 and 1 normally do not exist on the IEC bus; however,
> > screen (0) and tape (1) are valid targets for open(), too, aren't they?
> > Thus, distinguishing between device and drive in "n:name" with n < 2 or
> > not is not an option, either.
> 
> How about
> 
>   - 8::0:name
>   - 8::@0:name
>   - 8::name
> 
> Assuming that the colon is not allowed in "normal" file names, using it twices
> allows to distinguish between IEC unit and drive.

We always discussed floppy drives here, but we neglected the fact that
there are also other devices.

For example, The colon is a perfectly valid filename for a tape file,
for example. Unfortunately, almost every char seems to be valid for a
tape file.

I just tested to write a file named "=$:!$%&/()=" (without the quotation
marks) with SAVE, it worked like a charm.

Also remember that the OPEN for RS232 gets some bytes, which are just
bit mask. Thus, opening RS232 this way means that ANY character given is
valid.

Even when we restrict to IEC devices only: Does anyone here know for
sure how printers behave w.r.t. file names given?

What about the equivalent of OPEN 1,8,15,"M-W"CHR$(al)CHR$(ah)CHR$(1)CHR$(a),
which writes the byte a to the address (al + ah*256) in the floppy RAM?
What if al, ah or a are just the representations of our delimiter (i.e.,
the colon)?


For me, the conclusion is simple: We do not have many chars that are not
valid commonly for all cases. Thus, the only option that comes to
mind for me is to say: The device number *must* be specified in front of
the file name. Thus, the format would be to have "8:name", "10:name" or
":name", anything else is invalid.

This even makes the parser simpler. Of course, we could also say that
the device number has to be 2 chars always, which would make for the
simplest parser possible.

Anyway, this way, we would not have any problem with the ambiguity of
the colon, as we know for sure that the first colon is the separator
between device number and file name.

Regards,
Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Aug 11 21:31:41 2012

This archive was generated by hypermail 2.1.8 : 2012-08-11 21:31:44 CEST