|
libcfe
0.12.1
some useful C-functions
|
#include <sys/stat.h>Go to the source code of this file.
Macros | |
| #define | TYPE_DIR S_IFDIR |
| #define | TYPE_REG S_IFREG |
| #define | TYPE_LNK S_IFLNK |
| #define | TYPE_SOC S_IFSOCK |
| #define | TYPE_FIF S_IFIFO |
| #define | TYPE_CDEV S_IFCHR |
| #define | TYPE_BDEV S_IFBLK |
| #define | TYPE_NONE 0 |
| #define | TYPE_DEV (TYPE_BDEV | TYPE_CDEV) |
| #define | TYPE_NODIR (TYPE_REG | TYPE_LNK | TYPE_SOC | TYPE_FIF | TYPE_DEV) |
| #define | PATH_R 4 |
| request read permission More... | |
| #define | PATH_W 2 |
| request write permission More... | |
| #define | PATH_X 1 |
| request execute permission More... | |
| #define | PATH_NOCHECK 0 |
| do not test permission More... | |
| #define | check_file_exists(file, mode) check_path_exists(file, S_IFREG, mode) |
| #define | check_dir_exists(dir, mode) check_path_exists(dir, S_IFDIR, mode) |
Functions | |
| int | check_path_exists (const char *path, mode_t type, mode_t mode) |
| #define check_dir_exists | ( | dir, | |
| mode | |||
| ) | check_path_exists(dir, S_IFDIR, mode) |
Shorthand to check if dir is a directory. See check_path_exists.
Definition at line 33 of file check_path_exists.h.
| #define check_file_exists | ( | file, | |
| mode | |||
| ) | check_path_exists(file, S_IFREG, mode) |
Shorthand to check if file is a regular file. See check_path_exists.
Definition at line 28 of file check_path_exists.h.
| #define PATH_NOCHECK 0 |
do not test permission
Definition at line 23 of file check_path_exists.h.
| #define PATH_R 4 |
request read permission
Definition at line 20 of file check_path_exists.h.
| #define PATH_W 2 |
request write permission
Definition at line 21 of file check_path_exists.h.
| #define PATH_X 1 |
request execute permission
Definition at line 22 of file check_path_exists.h.
| #define TYPE_BDEV S_IFBLK |
Definition at line 14 of file check_path_exists.h.
| #define TYPE_CDEV S_IFCHR |
Definition at line 13 of file check_path_exists.h.
Definition at line 16 of file check_path_exists.h.
| #define TYPE_DIR S_IFDIR |
Definition at line 7 of file check_path_exists.h.
| #define TYPE_FIF S_IFIFO |
Definition at line 12 of file check_path_exists.h.
| #define TYPE_LNK S_IFLNK |
Definition at line 9 of file check_path_exists.h.
Definition at line 17 of file check_path_exists.h.
| #define TYPE_NONE 0 |
Definition at line 15 of file check_path_exists.h.
| #define TYPE_REG S_IFREG |
Definition at line 8 of file check_path_exists.h.
| #define TYPE_SOC S_IFSOCK |
Definition at line 11 of file check_path_exists.h.
| int check_path_exists | ( | const char * | path, |
| mode_t | type, | ||
| mode_t | mode | ||
| ) |
Check the existence, type and permissions of a path.
| [in] | path | Pointer to a string representing the path. |
| [in] | type | The type the path should be (0 disables this check). |
| [in] | mode | Type of access the path should have (0 disables this check). |
Definition at line 60 of file check_path_exists.c.