brewco/futil.c

changeset 441
bde74a8f2ad7
parent 409
cdf68044adaf
child 445
3ec477cda546
equal deleted inserted replaced
440:8df3252b688f 441:bde74a8f2ad7
56 return FALSE; 56 return FALSE;
57 } 57 }
58 } 58 }
59 59
60 60
61
62 /*
63 * Test if the given file exists. The second option is:
64 * R_OK - test for Read rights
65 * W_OK - test for Write rights
66 * X_OK - test for eXecute rights
67 * F_OK - test file presence only
68 */
69 int file_exist(char *path, int mode)
70 {
71 if (access(path, mode) != 0)
72 return errno;
73
74 return 0;
75 }
76
77

mercurial