Skip to content
Snippets Groups Projects
Commit 92998cf8 authored by slevy's avatar slevy
Browse files

Add emulation of access() (in terms of fopen()!). I *think* Windows

doesn't already have one.
parent 3d48b196
No related branches found
No related tags found
No related merge requests found
......@@ -63,4 +63,12 @@ double rint(double v) {
return floor(v + 0.5);
}
int access(char *fname, int how) {
FILE *f;
if(fname == NULL || (f = fopen(fname, "r")) == NULL)
return -1;
fclose(f);
return 0;
}
#endif /*WIN32*/
......@@ -18,4 +18,7 @@ extern int random();
extern double rint(double);
extern int access(char *fname, int how);
#define R_OK 004
#endif /*WIN32*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment