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 9
9
#include <unistd.h>
10
10
#endif /* ifdef _WIN32 */
11
11
12
+ // Returns the string describing the meaning of `errno` code (by calling `strerror`).
12
13
char * stdlib_strerror (size_t * len ){
13
14
char * err = strerror (errno );
14
15
* len = strlen (err );
15
16
return err ;
16
17
}
17
18
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`.
18
22
int stdlib_make_directory (const char * path ){
19
23
int code ;
20
24
#ifdef _WIN32
@@ -27,6 +31,9 @@ int stdlib_make_directory(const char* path){
27
31
return (!code ) ? 0 : errno ;
28
32
}
29
33
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`.
30
37
int stdlib_remove_directory (const char * path ){
31
38
int code ;
32
39
#ifdef _WIN32
You can’t perform that action at this time.
0 commit comments