Hack to open resource fork on the Mac: open(filename, '*rb').

This commit is contained in:
Guido van Rossum 1991-02-13 23:25:27 +00:00
parent 33f1770ed8
commit a08095ab02
1 changed files with 10 additions and 2 deletions

View File

@ -61,9 +61,17 @@ newfileobject(name, mode)
f = (fileobject *) newopenfileobject((FILE *)NULL, name, mode); f = (fileobject *) newopenfileobject((FILE *)NULL, name, mode);
if (f == NULL) if (f == NULL)
return NULL; return NULL;
if ((f->f_fp = fopen(name, mode)) == NULL) { #ifdef THINK_C
if (*mode == '*') {
FILE *fopenRF();
f->f_fp = fopenRF(name, mode+1);
}
else
#endif
f->f_fp = fopen(name, mode);
if (f->f_fp == NULL) {
err_errno(RuntimeError);
DECREF(f); DECREF(f);
err_errno(RuntimeError); /* XXX Should use another error */
return NULL; return NULL;
} }
return (object *)f; return (object *)f;