shithub: fsgen

Download patch

ref: 742636e89d40c537742b140d736a8b8827885984
parent: 8eebbe9f634bc389e168e78dcff3fbf9ec8d42ff
author: sirjofri <sirjofri@sirjofri.de>
date: Tue Mar 24 08:43:28 EDT 2026

adds custom mode to output, with default modes for files and dirs

--- a/code.c
+++ b/code.c
@@ -296,7 +296,9 @@
 		print("			.name = \"%s\",\n", s+1);
 		
 		if (f->isdir) {
-			print("			.mode = DMDIR,\n");
+			print("			.mode = %s|DMDIR,\n", f->mode ? f->mode : "0775");
+		} else {
+			print("			.mode = %s,\n", f->mode ? f->mode : "0664");
 		}
 		print("		},\n");
 		if (f->hasread) {
--- a/dat.h
+++ b/dat.h
@@ -8,6 +8,7 @@
 	int hasread;
 	int haswrite;
 	int hasstat;
+	char *mode;
 	char **parts;
 	VFile *next;
 };
--