1
0
src/wip/scrut/libscrut.c

8 lines
333 B
C
Raw Normal View History

2023-12-18 07:09:33 +00:00
#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; }