8 lines
333 B
C
8 lines
333 B
C
|
#include "libfileis.h"
|
||
|
#include <unistd.h> /* access(3), F_OK, R_OK, W_OK, X_OK */
|
||
|
|
||
|
int f_executable(char *path){ return access(path, X_OK) == 0; }
|
||
|
int f_exists(char *path){ return access(path, F_OK) == 0; }
|
||
|
int f_readable(char *path){ return access(path, R_OK) == 0; }
|
||
|
int f_writeable(char *path){ return access(path, W_OK) == 0; }
|