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

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2012-08-10 16:53:21
Hello again,

* On Fri, Aug 10, 2012 at 04:41:03PM +0200 Oliver Schmidt wrote:
> Hi,
> 
> >>    For example
> >>    open("8#0:name", ...
> >
> > Note that open("#0", ...) is perfectly legal for the 1541 (opening a
> > specific buffer).
> >
> > Thus, using the "#" is not completely unproblematic.
> 
> Again - I was introducing '#' into the discussion by mistake. I
> intended to discuss ':' only.

André's idea to have two different chars (I think this was meant this
way?) would have been a good one, that's why I answered to that.

> > The double colon syntax proposes elsewhere is also not unproblematic.
> >
> > Look at the following syntaxes:
> > - 8:0:name
> 
> This would mean unit 8 drive 0.

Yes. But: The computer has to process the "8:" and skip it, sending
everything else to the drive.

> > - 8:@0:name (yes, overwrite-with-at is problematic, I know...)
> 
> This would mean unit 8 and te rest would behave in the same way
> "@0:name" would behave today.

Agian, the "8:" has to be skipped by the computer, the rest is processed
by the drive.

> > - 8:@name
> 
> This would mean unit 8 and te rest would behave in the same way
> "@name" would behave today.

Here, again, the "8:" must be skipped by the computer.

I should have had more examples, because I missed some important ones:

- @0:name
- @name
- 0:name

All three of them have to be sent verbatim to the floppy.

So, just searching for a colon in the C library would not be sufficient.

> I'm not sure if I understand you correctly but after having learned
> that there may be very well more than two drives I already modified my
> proposal:
> 
> n:name always means unit n. In order to specify a drive it is
> obligatory to specify a unit first like in n:m:name meaning unit n
> drive m.

I was reading and reading this again and trying to find my
counterargument, only to see that this would in fact solve my list items
above.

BUT: This proposal would surely break existing code. Also, it would not
be possible to have the new way optional.

I still like the chdir()/getcwd() proposal:

- chdir("8") --> _curunit = 8;

Of course, it could also be more complicated. This would be optional, it
would not break existing code and it would not lead to surprises.

Think about anyone wanting to translate some BASIC program to C. He
would not only have to translate the statements, but also check each and
every file name if it has to be translated...

Even formatting (OPEN 1,8,15,"N:NAME,ID") would need a translation.


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 Fri Aug 10 16:54:01 2012

This archive was generated by hypermail 2.1.8 : 2012-08-10 16:54:04 CEST