|
LMMS
|
#include "filesystem.h"#include "lilv_config.h"#include "lilv_internal.h"#include <dirent.h>#include <unistd.h>#include <sys/stat.h>#include <errno.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | _POSIX_C_SOURCE 200809L /* for fileno */ |
| #define | _BSD_SOURCE 1 /* for realpath, symlink */ |
| #define | _DEFAULT_SOURCE 1 /* for realpath, symlink */ |
| #define | PAGE_SIZE 4096 |
Functions | |
| static bool | lilv_is_dir_sep (const char c) |
| char * | lilv_temp_directory_path (void) |
| Return the path to a directory suitable for making temporary files. | |
| bool | lilv_path_is_absolute (const char *path) |
| Return true iff path is an absolute path. | |
| bool | lilv_path_is_child (const char *path, const char *dir) |
| Return true iff path is a child of dir. | |
| char * | lilv_path_current (void) |
| Return the current working directory. | |
| char * | lilv_path_absolute (const char *path) |
| char * | lilv_path_absolute_child (const char *path, const char *parent) |
| char * | lilv_path_relative_to (const char *path, const char *base) |
| char * | lilv_path_parent (const char *path) |
| char * | lilv_path_filename (const char *path) |
| char * | lilv_path_join (const char *a, const char *b) |
| Join path a and path b with a single directory separator between them. | |
| char * | lilv_path_canonical (const char *path) |
| bool | lilv_path_exists (const char *path) |
| Return true iff path points to an existing file system entry. | |
| bool | lilv_is_directory (const char *path) |
| Return true iff path points to an existing directory. | |
| int | lilv_copy_file (const char *src, const char *dst) |
| int | lilv_symlink (const char *oldpath, const char *newpath) |
| int | lilv_flock (FILE *file, bool lock, bool block) |
| void | lilv_dir_for_each (const char *path, void *data, void(*f)(const char *path, const char *name, void *data)) |
| char * | lilv_create_temporary_directory_in (const char *pattern, const char *parent) |
| char * | lilv_create_temporary_directory (const char *pattern) |
| int | lilv_create_directories (const char *dir_path) |
| static off_t | lilv_file_size (const char *path) |
| int | lilv_remove (const char *path) |
| Remove the file or empty directory at path. | |
| bool | lilv_file_equals (const char *a_path, const char *b_path) |
| Return true iff the given paths point to files with identical contents. | |
| #define _BSD_SOURCE 1 /* for realpath, symlink */ |
| #define _DEFAULT_SOURCE 1 /* for realpath, symlink */ |
| #define _POSIX_C_SOURCE 200809L /* for fileno */ |
| #define PAGE_SIZE 4096 |
Copy the file at path src to path dst.
Create the directory dir_path and any parent directories if necessary.
| char * lilv_create_temporary_directory | ( | const char * | pattern | ) |
Create a unique temporary directory.
This is like lilv_create_temporary_directory_in(), except it creates the directory in the system temporary directory.
Create a unique temporary directory in a specific directory.
The last six characters of pattern must be XXXXXX and will be replaced with random characters. This works roughly like mkdtemp, except the pattern should only be a directory name, not a full path. The created path will be a child of the given parent directory.
| void lilv_dir_for_each | ( | const char * | path, |
| void * | data, | ||
| void(* | f )(const char *path, const char *name, void *data) ) |
Visit every file in the directory at path.
Return true iff the given paths point to files with identical contents.
| int lilv_flock | ( | FILE * | file, |
| bool | lock, | ||
| bool | block ) |
Set or remove an advisory exclusive lock on file.
If the lock is true and the file is already locked by another process, or by this process via a different file handle, then this will not succeed and non-zero will be returned.
| file | Handle for open file to lock. |
| lock | True to set lock, false to release lock. |
| block | If true, then this call will block until the lock is acquired. |
|
static |
| bool lilv_is_directory | ( | const char * | path | ) |
Return true iff path points to an existing directory.
| char * lilv_path_absolute | ( | const char * | path | ) |
Return path as an absolute path.
If path is absolute, an identical copy of it is returned. Otherwise, the returned path is relative to the current working directory.
| char * lilv_path_canonical | ( | const char * | path | ) |
Return path as a canonicalized absolute path.
This expands all symbolic links, relative references, and removes extra directory separators.
| char * lilv_path_current | ( | void | ) |
Return the current working directory.
| bool lilv_path_exists | ( | const char * | path | ) |
Return true iff path points to an existing file system entry.
| char * lilv_path_filename | ( | const char * | path | ) |
Return the filename component of path without any directories.
Returns the empty string if path is the root path.
| bool lilv_path_is_absolute | ( | const char * | path | ) |
Return true iff path is an absolute path.
Return true iff path is a child of dir.
| char * lilv_path_parent | ( | const char * | path | ) |
Return the path to the directory that contains path.
Returns the root path if path is the root path.
Return path relative to base if possible.
If path is not within base, a copy is returned. Otherwise, an equivalent path relative to base is returned (which may contain up-references).
Create a symlink at newpath that points to oldpath.
| char * lilv_temp_directory_path | ( | void | ) |
Return the path to a directory suitable for making temporary files.