Dik T. Winter wrote, On 04/02/07 03:08:
There is quite some difference. On all systems there are calls to
'fopen' that will succeed. I know of systems where a 'file list
open' will always fail.
I know of systems where opening a binary file in text mode fails.
So it fails. I don't have a problem with that.
Still the remaining question is: should it open the resource or the
data fork? All these things are pretty system specific, so using a
utility with Unix in mind may give pretty weird results on other
systems.
Well, since C does not have any support for data/resource forks it would
obviously only deal with whichever that C implementation uses when you
do an fopen. I.e. you have exactly the same problem as any program
written in C on such an implementation and you would take the same
route. This might make it less useful that it could otherwise be, but it
would still work for any file that a standard C program can work on. So
unless you are saying you cannot open *any* file without using some
non-standard method to specify which fork the program would still work,
just with some limitations.
Having said that, if I was writing the implementation, I would seriously
consider some kind of syntax on the file name to allow you to specify
which fork, but I'm not writing the implementation so you are stuck with
whatever the implementation provides.
Also note that I am not saying everything can be written in standard C
nor that there are not sometimes advantages to using non-standard
extensions, just that some useful things can be and they will work, even
if with some limitations, on (in this case hosted) C implementations.