Mark A. Stevens wrote:
On Sun, Jun 5, 2022 at 07:32 PM, Jay Maynard wrote:
Except that your proposal is not valid C syntax. That's
why the first proposal is done that way.
Please help me understand your comment. Given that the definition
is ...
FILE *fopen(const char *restrict pathname, const char *restrict mode);
and:
"The fopen() function opens the file whose name is the string
pointed to by pathname and associates a stream with it."
How is using a DDNAME, which points to a file not valid C syntax?
Or is that what fdopen would be used for?
Maybe it's because your proposal:
fopen("my.file",w,recfm=v,lrecl=300,blksize=304);
Does not match the very C definition (syntax) that you quoted? In 'C', the function 'fopen' is passed only TWO parameters, BOTH being string parameters, whereas in your proposed syntax, the function is being passed FIVE parameters, each of the second through fifth parameters are of an unknown/undefined type. Perhaps you meant to enclose them with double quotes like Dave proposed?
I myself haven't been following this thread too closely and I have zero interest in Paul's hacks, but I would listen to Dave Wade. He knows what he's talking about/doing.
Me? I would vote for Dave's original proposed syntax, but with blanks instead of commas as the separators in the second string parameter:
fopen( "my.file", "w recfm=v lrecl=300 blksize=304" );
<shrug>
--
"Fish" (David B. Trout)
Software Development Laboratories
mail: fish@...