shithub: mapfs

Download patch

ref: e78b966c9df18dce119421db741881d94a549dfd
parent: 1885f38f890e6e85d0dd53f07b9c4f4b02c25073
author: sirjofri <sirjofri@sirjofri.de>
date: Fri Mar 28 07:39:01 EDT 2025

automatically create map cache directory

--- a/mapfs.c
+++ b/mapfs.c
@@ -89,6 +89,7 @@
 main(int argc, char **argv)
 {
 	char *srv = nil;
+	int fd;
 	
 	ARGBEGIN{
 	case 's':
@@ -104,6 +105,13 @@
 		maxzoom = atoi(EARGF(usage()));
 		break;
 	}ARGEND;
+	
+	if (access(cache, AEXIST) < 0) {
+		fd = create(cache, OREAD, 0777|DMDIR);
+		if (fd < 0)
+			sysfatal("unable to create cache directory: %r");
+		close(fd);
+	}
 	
 	uid = getuser();