Controllato funzionamento existsFile() createFile() in logic.c

This commit is contained in:
admin committed 2025-10-15 19:09:35 +02:00
1 parent d63e020759
commit a38fe7af52
2 files changed
+7 -4

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ void createFile(const char *fname) {
} }
char* getProducts(const char *fname) { char* getProducts(const char *fname) {
FILE *file; /* FILE *file;
if((file=fopen(fname, "r"))==NULL) { if((file=fopen(fname, "r"))==NULL) {
printf("Errore nell'apertura del file"); printf("Errore nell'apertura del file");
@@ -50,7 +50,7 @@ char* getProducts(const char *fname) {
count++; count++;
} }
fclose(file); fclose(file);
*/
} }
int getCount(){ int getCount(){
+5 -2
View File
@@ -7,8 +7,11 @@
#include "../include/globals.h" #include "../include/globals.h"
int main() { int main() {
printf("%d", exists("qwestoeuntest")); /* Working
printf("%d", existsFile("qwestoeuntest"));
createFile("qwestoeuntest"); createFile("qwestoeuntest");
printf("%d", exists("qwestoeuntest")); printf("%d", existsFile("qwestoeuntest"));
*/
return 0; return 0;
} }