File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 99#include <unistd.h>
1010#endif /* ifdef _WIN32 */
1111
12+ // Returns the string describing the meaning of `errno` code (by calling `strerror`).
1213char * stdlib_strerror (size_t * len ){
1314 char * err = strerror (errno );
1415 * len = strlen (err );
1516 return err ;
1617}
1718
19+ // Wrapper to the platform's `mkdir`(make directory) call.
20+ // Uses `mkdir` on unix, `_mkdir` on windows.
21+ // Returns 0 if successful, otherwise returns the `errno`.
1822int stdlib_make_directory (const char * path ){
1923 int code ;
2024#ifdef _WIN32
@@ -27,6 +31,9 @@ int stdlib_make_directory(const char* path){
2731 return (!code ) ? 0 : errno ;
2832}
2933
34+ // Wrapper to the platform's `rmdir`(remove directory) call.
35+ // Uses `rmdir` on unix, `_rmdir` on windows.
36+ // Returns 0 if successful, otherwise returns the `errno`.
3037int stdlib_remove_directory (const char * path ){
3138 int code ;
3239#ifdef _WIN32
You can’t perform that action at this time.
0 commit comments