All pastes #10539 Raw Edit

Something

public cpp v1 · immutable
#10539 ·published 2005-04-28 22:53 UTC
rendered paste body
{	// recursive mkdir; maybe move this to a func?	char *eop;	int i;	bool fs = false;		for (i = strlen(pathname) - 1; i < strlen(pathname); fs ? ++i : --i) {		if (i < 0)			return -1;	// Couldn't mkdir :(		if (pathname[i] == '/') {			pathname[i] = '\0';			if (!mkdir(pathname, 0777)) {				fs = true;				printf("mkdir %s\n", pathname);			}			pathname[i] = '/';		}	}}