diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-04 08:41:27 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-04 08:41:27 -0500 |
commit | 674768caa67722992a16fbe1453ce625fa149955 (patch) | |
tree | 2b1e6321552fe107a939fdd758683380539a0fcf /include/utils.h | |
parent | a691ba8c27d71fc4887500abe677a01809727600 (diff) | |
download | stasis-674768caa67722992a16fbe1453ce625fa149955.tar.gz |
xmkstemp allow setting file mode
* add usage comment function
Diffstat (limited to 'include/utils.h')
-rw-r--r-- | include/utils.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/utils.h b/include/utils.h index d32a123..52f4f2d 100644 --- a/include/utils.h +++ b/include/utils.h @@ -55,7 +55,22 @@ void debug_shell(); * @return system path to the temporary file * @return NULL on failure */ -char *xmkstemp(FILE **fp); +char *xmkstemp(FILE **fp, const char *mode); + +/** + * Is the path an empty directory structure? + * + * ```c + * if (isempty_dir("/some/path")) { + * fprintf(stderr, "The directory is is empty!\n"); + * } else { + * printf("The directory contains dirs/files\n"); + * } + * ``` + * + * @param path directory + * @return 0 = no, 1 = yes + */ int isempty_dir(const char *path); #endif //OMC_UTILS_H |