29 #ifndef REGIFY_UTIL_IO_H
30 #define REGIFY_UTIL_IO_H
31 #include <sys/types.h>
181 RUAPI
int ruOpenTmp(
char *pathTemplate,
int flags,
int mode, int32_t *code);
252 #define RU_WALK_FOLDER_FIRST 0x1
256 #define RU_WALK_FOLDER_LAST 0x2
260 #define RU_WALK_NO_RECURSE 0x4
264 #define RU_WALK_NO_SELF 0x8
269 #define RU_WALK_UNIX_SLASHES 0x10
RUAPI int32_t ruFilteredFolderWalk(trans_chars folder, uint32_t flags, entryFilter filter, entryMgr actor, ptr ctx)
Like ruFolderWalk with additional filtering capability. Folder entries . and .. are not passed to fil...
RUAPI int32_t ruFolderWalk(trans_chars folder, uint32_t flags, entryMgr actor, ptr ctx)
Decends into given folder depth first and calls actor on each entry. Folder entries ....
RUAPI ru_int ruFolderEntries(trans_chars folder)
Returns the number of folder entries including itself.
RUAPI int ruFileTryRename(trans_chars oldName, trans_chars newName)
Renames a given file like ruFileRename, but fails when newName already exists instead of overwriting ...
RUAPI int32_t ruStat(trans_chars filepath, ruStat_t *dest)
RUAPI int ruFileRename(trans_chars oldName, trans_chars newName)
RUAPI bool ruIsSymlink(trans_chars filename)
RUAPI int ruFileCopy(trans_chars srcpath, trans_chars destpath)
Copies srcpath to destpath.
RUAPI bool ruIsDir(trans_chars filename)
RUAPI bool ruIsExecutable(trans_chars filename)
RUAPI bool ruIsFile(trans_chars filename)
RUAPI sec_t ruFileUtcTime(trans_chars filePath, int32_t *code)
Return the UTC modification date of the given file if it exists.
RUAPI rusize_s ruWrite(int oh, trans_ptr contents, rusize length)
RUAPI rusize ruFileSize(trans_chars filePath, int32_t *code)
Return the size of the given file if it exists.
RUAPI alloc_chars ruFullPath(trans_chars filePath)
Returns an absolute filepath leading to the given relative path.
RUAPI alloc_chars ruPathJoin(trans_chars base, trans_chars file)
Returns base and file joined with the a unix filesystem slash in a new string.
RUAPI int32_t ruFileSetContents(trans_chars filename, trans_chars contents, rusize length)
bool(* entryFilter)(trans_chars folderPath, trans_chars fileName, bool isFolder, ptr ctx)
A function that is called with each entry of a ruFolderWalk to decide whether that entry should be pr...
Definition: io.h:285
RUAPI alloc_chars ruPathJoinNative(trans_chars base, trans_chars file)
Returns base and file joined with the filesystem slash in a new string.
RUAPI alloc_chars ruPathMultiJoin(int parts,...)
Return a path by concatenating the given parts number of parameters using a unix style directory slas...
RUAPI bool ruFileExists(trans_chars filename)
RUAPI int32_t ruFileSetUtcTime(trans_chars filePath, sec_t date)
Set UTC access and mod time of given filePath to given date.
RUAPI alloc_chars ruPathMultiJoinNative(int parts,...)
Return a path by concatenating the given parts number of parameters using the platform native directo...
RUAPI FILE * ruFOpen(trans_chars filepath, trans_chars mode, int32_t *code)
RUAPI perm_chars ruBaseName(perm_chars filePath)
Returns the filename of a path with the preceding path removed.
RUAPI perm_chars ruFileExtension(perm_chars filePath)
Returns the extension part of the given file name if there is one.
RUAPI int32_t ruFolderRemove(trans_chars folder)
Recursively delete given folder and all it's sub contents. If given path is a file or symlink,...
RUAPI alloc_chars ruDirName(trans_chars filePath)
Returns the dirname part of a full path without the trailing slash.
RUAPI int ruOpen(trans_chars filepath, int flags, int mode, int32_t *code)
RUAPI int ruFileGetContents(trans_chars filename, alloc_chars *contents, rusize *length)
RUAPI int ruOpenTmp(char *pathTemplate, int flags, int mode, int32_t *code)
struct stat ruStat_t
Definition: io.h:98
int32_t(* entryMgr)(trans_chars fullPath, bool isFolder, ptr ctx)
A function that is called with each entry of a ruFolderWalk.
Definition: io.h:295
RUAPI int32_t ruDiskFree(trans_chars path, uint64_t *total, uint64_t *avail)
RUAPI int32_t ruMkdir(trans_chars pathname, int mode, bool deep)
RUAPI int ruFileRemove(trans_chars filename)
intptr_t ru_int
A pointer sized integer type for collections like ruMap or ruList.
Definition: regify-util.h:328
const void * trans_ptr
A transient pointer.
Definition: regify-util.h:287
const char * trans_chars
A transient NULL terminated string pointer.
Definition: regify-util.h:186
const char * perm_chars
A permanent NULL terminated string pointer.
Definition: regify-util.h:176
long sec_t
A signed type for expressing seconds.
Definition: regify-util.h:312
char * alloc_chars
An allocated NULL terminated string pointer.
Definition: regify-util.h:199
size_t rusize
Abstracted version of size_t.
Definition: regify-util.h:338
void * ptr
A generic pointer.
Definition: regify-util.h:304
signed long rusize_s
Abstracted version of size_t but signed.
Definition: regify-util.h:152