From 826f7c889e5f6ac694273986db27384e18e03b97 Mon Sep 17 00:00:00 2001 From: parking_turkeys Date: Thu, 6 Aug 2026 16:56:17 -0400 Subject: [PATCH 1/1] this doesnt work so ig i have to use the w*ndows way... --- main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 main.c diff --git a/main.c b/main.c new file mode 100644 index 0000000..1020918 --- /dev/null +++ b/main.c @@ -0,0 +1,33 @@ +#include +#include + +#define LOGFILE "log.txt" + +static int log_args(int argc, char *argv[]); + +int main(int argc, char *argv[]) +{ + //test ver: just like. log the arguments lol!! + log_args(1, (char*[]){"a", "a"}); +}; + +int log_args(int argc, char *argv[]) +{ + FILE *fp; + fp = fopen(LOGFILE, "a"); + /* no idea why this wont work lmao??? + for (int i = 1; i < argc; i++) { //loop through argv[] + char c; + for (int n = 0; (c = argv[i][n]) != '\0'; n++) { //loop through each character + putc(c, fp); + }; + putc(' ', fp); + }; + */ + fprintf(fp, "The tool has been CALLED!"); + + putc('\n', fp); + fclose(fp); + + return 1; +}; -- 2.47.3