![]() |
PUMA Library Reference Manual
|
#include <Puma/SysCall.h>
Encapsulates system dependent file system operations.
Static Public Member Functions | |
| static const char * | mktemp (const char *prefix, ErrorSink *err=(ErrorSink *) 0) |
| Create a temporary file name, needs to be freed by the caller. | |
| static int | open_excl (const char *path, int flags, ErrorSink *err=(ErrorSink *) 0) |
| Open a file in exclusive file locking mode. | |
| static int | create_excl (const char *path, int mode, ErrorSink *err=(ErrorSink *) 0) |
| Create and open a file in exclusive file locking mode. | |
| static bool | close_excl (int fd, ErrorSink *err=(ErrorSink *) 0) |
| Close a file opened in exclusive file locking mode. | |
| static int | open (const char *path, int flags, ErrorSink *err=(ErrorSink *) 0) |
| Open a file in non-exclusive mode. | |
| static int | create (const char *path, int mode, ErrorSink *err=(ErrorSink *) 0) |
| Create and open a file in non-exclusive mode. | |
| static bool | close (int fd, ErrorSink *err=(ErrorSink *) 0) |
| Close a file opened in non-exclusive mode. | |
| static long | read (int fd, void *buffer, size_t n, ErrorSink *err=(ErrorSink *) 0) |
| Read n bytes from a file into the given buffer. | |
| static bool | stat (const char *path, FileInfo &info, ErrorSink *err=(ErrorSink *) 0) |
| Get information about a file. | |
| static bool | fstat (int fd, FileInfo &info, ErrorSink *err=(ErrorSink *) 0) |
| Get information about a file. | |
| static char * | readlink (const char *path, char *buffer, size_t len, ErrorSink *err=(ErrorSink *) 0) |
| Get the path to the file the given link points to. | |
| static FileHandle | fopen (const char *path, const char *mode, ErrorSink *err=(ErrorSink *) 0) |
| Open a file stream. | |
| static bool | fclose (FileHandle fh, ErrorSink *err=(ErrorSink *) 0) |
| Close a file stream. | |
| static DirHandle | opendir (const char *path, ErrorSink *err=(ErrorSink *) 0) |
| Open a directory stream. | |
| static bool | closedir (DirHandle dh, ErrorSink *err=(ErrorSink *) 0) |
| Close a directory stream. | |
| static const char * | readdir (DirHandle dh, DirEntryType *type=0, ErrorSink *err=(ErrorSink *) 0) |
| static bool | chdir (const char *path, ErrorSink *err=(ErrorSink *) 0) |
| Change the current working directory. | |
| static bool | mkdir (const char *path, ErrorSink *err=(ErrorSink *) 0) |
| Create a directory. | |
| static char * | getcwd (char *buffer, size_t len, ErrorSink *err=(ErrorSink *) 0) |
| Get the current working directory. | |
| static time_t | time (time_t *buffer, ErrorSink *err=(ErrorSink *) 0) |
| Get the current time. | |
| static void | MakeUnixPath (char *path) |
| Transform the given path into a Unix path by replacing all backslashes with slashes. | |
| static void | MakeDosPath (char *path) |
| Transform the given path into a MS-DOS path by replacing all slashes with backslashes. | |
| static bool | canonical (Filename filename, Filename &result, ErrorSink *err=0) |
| Get the canonical path name for an existing file. | |
| static char * | absolute (const char *filename, ErrorSink *err=(ErrorSink *) 0) |
| Get the absolute path name for an existing file. | |
|
static |
Get the absolute path name for an existing file.
| filename | The filename of the file. |
| err | Optional error reporting stream. |
|
static |
Get the canonical path name for an existing file.
| filename | The filename of the file. |
| result | The resulting canonical path name. |
| err | Optional error reporting stream. |
Change the current working directory.
| path | The path to the new working directory. |
| err | Optional error reporting stream. |
Close a file opened in non-exclusive mode.
| fd | The file descriptor of the file to close. |
| err | Optional error reporting stream. |
Close a file opened in exclusive file locking mode.
| fd | The file descriptor of the file to close. |
| err | Optional error reporting stream. |
Close a directory stream.
| dh | The handle to the directory stream. |
| err | Optional error reporting stream. |
|
static |
Create and open a file in non-exclusive mode.
| path | The path to the file. |
| mode | The file creation mode. |
| err | Optional error reporting stream. |
|
static |
Create and open a file in exclusive file locking mode.
| path | The path to the file. |
| mode | The file creation mode. |
| err | Optional error reporting stream. |
|
static |
Close a file stream.
| fh | The handle to the file stream. |
| err | Optional error reporting stream. |
|
static |
Open a file stream.
| path | The path to the file to open. |
| mode | The file open mode. |
| err | Optional error reporting stream. |
|
static |
Get information about a file.
| fd | The file descriptor of the file. |
| info | The file information object to fill. |
| err | Optional error reporting stream. |
|
static |
Get the current working directory.
| buffer | A buffer to be filled with the path to the current working directory. |
| len | The size of the buffer. |
| err | Optional error reporting stream. |
|
static |
Transform the given path into a MS-DOS path by replacing all slashes with backslashes.
| path | The path to transform. |
|
static |
Transform the given path into a Unix path by replacing all backslashes with slashes.
| path | The path to transform. |
Create a directory.
| path | The path to the new directory. |
| err | Optional error reporting stream. |
|
static |
Create a temporary file name, needs to be freed by the caller.
| prefix | The file name prefix. |
| err | Optional error reporting stream. |
|
static |
Open a file in non-exclusive mode.
| path | The path to the file. |
| flags | The file open flags. |
| err | Optional error reporting stream. |
|
static |
Open a file in exclusive file locking mode.
| path | The path to the file. |
| flags | The file open flags. |
| err | Optional error reporting stream. |
|
static |
Open a directory stream.
| path | The path to the directory to open. |
| err | Optional error reporting stream. |
|
static |
Read n bytes from a file into the given buffer.
| fd | The file descriptor of the file to read. |
| buffer | The buffer to fill with the bytes read. |
| n | The number of bytes to read. |
| err | Optional error reporting stream. |
|
static |
|
static |
Get the path to the file the given link points to.
| path | The path to the link. |
| buffer | The buffer to fill with the result. |
| len | The size of the buffer. |
| err | Optional error reporting stream. |
|
static |
Get information about a file.
| path | The path to the file. |
| info | The file information object to fill. |
| err | Optional error reporting stream. |