Quote:
Desired by whom?

By the scripter.

Quote:
Well no that's no alternative, because then the file would be overwritten if it exists. I'm just saying the two should be consistent, the -o switch opens the file whether or not the file exists (overwriting IF it does exist), the -n switch behavior should be the same, open the file whether or not it exists (creating a new file IF it doesn't exist).

If the -o switch behavior were consistent with the -n switch behavior, then it would create the file (overwriting IF it exists) and then fail, like the -n switch creates the file (IF it doesn't exist) and then fails.

I didn't realise that -o actually clears the file on opening. I assumed by "overwriting" it was just making clear that it wasn't in append-mode.

To be honest I'd rather /fopen had (or at least supported as alternative switches) the standard -r[+] -w[+] -a[+] switches available to the C fopen() function.


Spelling mistakes, grammatical errors, and stupid comments are intentional.