#include <basedir.h>#include <stdio.h>#include <sys/types.h>Go to the source code of this file.
Functions | |
Filesystem-related XDG Base Directory Queries | |
| char * | xdgDataFind (const char *relativePath, xdgHandle *handle) |
| char * | xdgConfigFind (const char *relativePath, xdgHandle *handle) |
| FILE * | xdgDataOpen (const char *relativePath, const char *mode, xdgHandle *handle) |
| FILE * | xdgConfigOpen (const char *relativePath, const char *mode, xdgHandle *handle) |
| int | xdgMakePath (const char *path, mode_t mode) |
Filesystem functions related to the XDG Base Directory specification.
| char* xdgConfigFind | ( | const char * | relativePath, | |
| xdgHandle * | handle | |||
| ) |
Find all existing config files corresponding to relativePath. Consider as performing
fopen(filename, "r")
on every possible filename and returning the successful filenames.
| relativePath | Path to scan for. | |
| handle | Handle to data cache, initialized with xdgInitHandle(). |
"/etc/xdg\0/home/jdoe/.config\0"
| FILE* xdgConfigOpen | ( | const char * | relativePath, | |
| const char * | mode, | |||
| xdgHandle * | handle | |||
| ) |
Open first possible config file corresponding to relativePath. Consider as performing
fopen(filename, mode)
on every possible filename and returning the first successful filename or NULL.
| relativePath | Path to scan for. | |
| mode | Mode with which to attempt to open files (see fopen modes). | |
| handle | Handle to data cache, initialized with xdgInitHandle(). |
NULL. Client must use fclose to close file. | char* xdgDataFind | ( | const char * | relativePath, | |
| xdgHandle * | handle | |||
| ) |
Find all existing data files corresponding to relativePath. Consider as performing
fopen(filename, "r")
on every possible filename and returning the successful filenames.
| relativePath | Path to scan for. | |
| handle | Handle to data cache, initialized with xdgInitHandle(). |
"/etc/share\0/home/jdoe/.local\0"
| FILE* xdgDataOpen | ( | const char * | relativePath, | |
| const char * | mode, | |||
| xdgHandle * | handle | |||
| ) |
Open first possible data file corresponding to relativePath. Consider as performing
fopen(filename, mode)
on every possible filename and returning the first successful filename or NULL.
| relativePath | Path to scan for. | |
| mode | Mode with which to attempt to open files (see fopen modes). | |
| handle | Handle to data cache, initialized with xdgInitHandle(). |
NULL. Client must use fclose to close file. | int xdgMakePath | ( | const char * | path, | |
| mode_t | mode | |||
| ) |
Create path by recursively creating directories. This utility function is not part of the XDG specification, but nevertheless useful in context of directory manipulation.
| path | The path to be created. | |
| mode | The permissions to use for created directories. This parameter is modified by the process's umask. For details, see mkdir(2)'s mode parameter. |
1.7.1