tools/extract-pkg.c
int mkdir_parents(char *path)
{
    char *slash = strrchr(path, '/');
    if (!slash || slash == path) {
        return 1;  // No parents to create.
    }
    *slash = 0;
    int ok = 0;
    if (mkdir_parents(path)) {
        if (mkdir(path, 0777) == 0 || errno == EEXIST) {
            ok = 1;
        } else {
            fprintf(stderr, "mkdir(%s): %s\n", path, strerror(errno));
        }
    }
    *slash = '/';
    return ok;
}
/**
 * mkdir_parents:  Create any nonexistent parent directories of the given path.
 *
 * [Parameters]
 *     path: Pathname for which to create parent directories (will be
 *         modified by this function but restored to its original state on
 *         return).
 * [Return value]
 *     True on success, false on error.
 */
Create any nonexistent parent directories of the given path.
[Parameters]
path: Pathname for which to create parent directories (will be
modified by this function but restored to its original state on
return).
[Return value]
True on success, false on error.
Create any nonexistent parent directories of the given path . [ Parameters ] path : Pathname for which to create parent directories ( will be modified by this function but restored to its original state on return ) . [ Return value ] True on success false on error .
int mkdir_parents(char *path)
{
    char *slash = strrchr(path, '/');
    if (!slash || slash == path) {
        return 1;  
    }
    *slash = 0;
    int ok = 0;
    if (mkdir_parents(path)) {
        if (mkdir(path, 0777) == 0 || errno == EEXIST) {
            ok = 1;
        } else {
            fprintf(stderr, "mkdir(%s): %s\n", path, strerror(errno));
        }
    }
    *slash = '/';
    return ok;
}
int mkdir_parents ( char * path ) { char * slash = strrchr ( path , ' ' ) ; if ( ! slash || slash == path ) { return 1 ; } * slash = 0 ; int ok = 0 ; if ( mkdir_parents ( path ) ) { if ( mkdir ( path , 0777 ) == 0 || errno == EEXIST ) { ok = 1 ; } else { fprintf ( stderr , " \n " , path , strerror ( errno ) ) ; } } * slash = ' ' ; return ok ; }
mkdir_parents:  Create any nonexistent parent directories of the given path.
mkdir_parents : Create any nonexistent parent directories of the given path .
// No parents to create.