#include <limits.h>
#include <linux/limits.h>
#include <dirent.h>
Go to the source code of this file.
Defines | |
| #define | PATH_MAX 4096 |
| #define | FILE_CLOSE(fhandle) |
Functions | |
| EXTERN_C_BEGIN LIBGIFT_EXPORT BOOL | file_exists (const char *file) |
| LIBGIFT_EXPORT BOOL | file_direxists (const char *path) |
| LIBGIFT_EXPORT BOOL | file_stat (const char *file, struct stat *stbuf) |
| LIBGIFT_EXPORT char * | file_dirname (const char *file) |
| LIBGIFT_EXPORT char * | file_basename (const char *file) |
| LIBGIFT_EXPORT char * | file_secure_path (const char *path) |
| LIBGIFT_EXPORT char * | file_read_line (FILE *f, char **outbuf) |
| Reads a line from an opened file. | |
| LIBGIFT_EXPORT char * | file_expand_path (const char *path) |
| LIBGIFT_EXPORT BOOL | file_create_path (const char *path, int mode) |
| LIBGIFT_EXPORT BOOL | file_mkdir (const char *path, int mode) |
| LIBGIFT_EXPORT FILE * | file_temp (char **out, char *module) |
| LIBGIFT_EXPORT BOOL | file_rmdir (const char *path) |
| LIBGIFT_EXPORT BOOL | file_cp (const char *src, const char *dst) |
| Copy a file. | |
| LIBGIFT_EXPORT BOOL | file_mv (const char *src, const char *dst) |
| Move a file. | |
| LIBGIFT_EXPORT BOOL | file_slurp (const char *path, char **data, unsigned long *len) |
| Slurp in a file. | |
| LIBGIFT_EXPORT BOOL | file_dump (const char *path, const char *data, unsigned long len) |
| LIBGIFT_EXPORT FILE * | file_open (const char *path, const char *mode) |
| LIBGIFT_EXPORT int | file_close (FILE *f) |
| LIBGIFT_EXPORT int | file_unlink (const char *path) |
| LIBGIFT_EXPORT DIR * | file_opendir (const char *dir) |
| LIBGIFT_EXPORT struct dirent * | file_readdir (DIR *dh) |
| LIBGIFT_EXPORT int | file_closedir (DIR *dh) |
| LIBGIFT_EXPORT char * | file_host_path (const char *gift_path) |
| Converts a UNIX-style path to a host specific path. | |
| LIBGIFT_EXPORT char * | file_unix_path (const char *host_path) |
| Converts a host specific path to a UNIX-style path. | |
Abstraction from commonly used file manipulation routines. Also includes portability wrappers for readdir and friends.
|
|
Value: Wrapper for file_close which will set the value pointed to by fhandle to NULL. |
|
|
Retrieve the last element of a fully qualified path. |
|
|
Wrapper for fclose. |
|
|
Portable closedir. |
|
||||||||||||
|
Copy a file. Manually copy the contents of src to dst. dst will be created if it does not exist.
|
|
||||||||||||
|
Similar to mkdir -p, except that the path is expected to have a trailing file entry which will not be created as a directory. Note that the return value says nothing about whether the _file_ exists.
|
|
|
Similar to file_exists, except that the path is checked to be a directory instead of a regular file. |
|
|
Retrieve the directory element from a fully qualified path. |
|
||||||||||||||||
|
Dumps the supplied data to a file on disk.
|
|
|
Determine if a file exists on disk, and is a regular file.
|
|
|
Expand a shell-like path to a fully qualified path.
|
|
|
Converts a UNIX-style path to a host specific path. For example, on Windows /C/Program Files/giFT becomes C: Files.
|
|
||||||||||||
|
Identical to mkdir -p. All path elements will be created with the supplied mode.
|
|
||||||||||||
|
Move a file. This function will attempt to use rename () first, and cp/unlink if that fails.
|
|
||||||||||||
|
Wrapper for fopen. |
|
|
Portable opendir. |
|
||||||||||||
|
Reads a line from an opened file. This function is designed to be used in a while loop as shown:
|
|
|
Portable readdir. |
|
|
Identical to rm -rf.
|
|
|
Secure a path by stripping '.' and '..' (and /.+/ on Windows) and failing if the path does not begin with a slash.
|
|
||||||||||||||||
|
Slurp in a file. This function creates a massive linear character array. Very unwise unless you really know what you're doing.
|
|
||||||||||||
|
Wrapper around stat to catch stupid errors.
|
|
||||||||||||
|
Unused. |
|
|
Converts a host specific path to a UNIX-style path. For example, on Windows C: Files becomes /C/Program Files/giFT.
|
|
|
Wrapper for unlink. |
1.3.7