#include <config.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "common.h"
Go to the source code of this file.
char* dgets |
( |
Dstring * |
dstr, |
|
|
FILE * |
in |
|
) |
| |
Definition at line 26 of file files.c.
33 while(fgets(buffer, 256, in) != NULL) {
34 int len = strlen(buffer);
36 if(buffer[len-1] ==
'\n') {
const char* file_basename |
( |
const char * |
filename) | |
|
Definition at line 49 of file files.c.
51 const char *ptr =
strrchr(filename,
'/');
53 return (ptr ? ptr + 1 : filename);
int file_exists |
( |
const char * |
filename) | |
|
Definition at line 72 of file files.c.
74 int status = (access(filename, F_OK) == 0);
77 filename, status ?
"Yes" :
"No"));
const char* file_extension |
( |
const char * |
filename) | |
|
Definition at line 56 of file files.c.
60 return (ptr ? ptr + 1 : NULL);
int file_readable |
( |
const char * |
filename) | |
|
Definition at line 63 of file files.c.
65 int status = (access(filename, R_OK) == 0);
68 filename, status ?
"Yes" :
"No"));