lasciamo stare open che non credo ti serva scendere al livello delle system call

FILE *f;
if((f=fopen("abc.txt", "r"))==NULL) {
f=fopen("abc.txt", "w")
}