diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-14 22:27:53 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-14 22:27:53 +0200 |
| commit | 1770c5f79e1af37c50500fcb58c0644801dce743 (patch) | |
| tree | 46b64b57f8f2141e65d027cc56f486b4976fc7b0 /src/logger/main.c | |
| parent | af1b88d8fc9c48b6ae07a9164f82525a0b9e2824 (diff) | |
Minor changes
Diffstat (limited to 'src/logger/main.c')
| -rw-r--r-- | src/logger/main.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/logger/main.c b/src/logger/main.c index 8c11878..b7833c5 100644 --- a/src/logger/main.c +++ b/src/logger/main.c @@ -11,7 +11,7 @@ #include <sys/stat.h> #include "../utils.h" -void start(char *power_path); +void start(char *power_path, char *busid, char *chipaddr); int main (int argc, char *argv []) { @@ -26,15 +26,27 @@ int main (int argc, char *argv []) char *base=basename(argv[1]); sscanf(base,"%[^-]-%[^-]",busid,chipaddr); - start("/home/loic/out.txt"); + start("/home/loic/out.txt", busid,chipaddr); return 0; } -void start(char *power_path){ +void start(char *power_path, char *busid, char *chipaddr){ if (access(power_path, F_OK) != 0){ printf("Could not read %s\n",power_path); exit(2); } + char outdir[255]; mkdir(STRINGIFY(LOGGER_DIR),0755); + sprintf(outdir,"%s/%s-%s/",STRINGIFY(LOGGER_DIR), busid,chipaddr); + mkdir(outdir,0755); + + char outfile[255]; + sprintf(outfile,"%s/%s",outdir,"flk"); + printf("aa %s\n",outfile); + + FILE *f; + f=fopen(outfile, "w"); + fclose(f); + }
\ No newline at end of file |
