Skip to content

Instantly share code, notes, and snippets.

@tangxinfa
tangxinfa / mkdir_p.c
Last active July 11, 2022 13:19 — forked from JonathonReinhart/SConstruct
mkdir -p implemented in C
#include <errno.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
int mkdir_p(char* path) {
int len = strlen(path);
if (len == 0) {