From 7eee20414c370ad0564e89b7b0f9874babeeb118 Mon Sep 17 00:00:00 2001 From: Vincenzo Nikodem Cesqui Podiani Date: Wed, 15 Oct 2025 19:09:35 +0200 Subject: [PATCH] Controllato funzionamento existsFile() createFile() in logic.c --- src/logic.c | 4 ++-- src/testLogic.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/logic.c b/src/logic.c index 76f18f7..967334d 100644 --- a/src/logic.c +++ b/src/logic.c @@ -34,7 +34,7 @@ void createFile(const char *fname) { } char* getProducts(const char *fname) { - FILE *file; +/* FILE *file; if((file=fopen(fname, "r"))==NULL) { printf("Errore nell'apertura del file"); @@ -50,7 +50,7 @@ char* getProducts(const char *fname) { count++; } fclose(file); - +*/ } int getCount(){ diff --git a/src/testLogic.c b/src/testLogic.c index 6430a56..ccbf9c7 100644 --- a/src/testLogic.c +++ b/src/testLogic.c @@ -7,8 +7,11 @@ #include "../include/globals.h" int main() { - printf("%d", exists("qwestoeuntest")); + /* Working + printf("%d", existsFile("qwestoeuntest")); createFile("qwestoeuntest"); - printf("%d", exists("qwestoeuntest")); + printf("%d", existsFile("qwestoeuntest")); + */ + return 0; }