From 3000681f0287ccf39974bb12e7e2ee043742a7a1 Mon Sep 17 00:00:00 2001 From: TriantaTV Date: Sun, 13 Nov 2022 17:45:17 -0600 Subject: [PATCH] Final additions for submission --- README.md | 26 ++++++++++++++++++++++++++ src/stuffy.c | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..eaf7c2f --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +#Stuffy +Made by: Gregory Crawford (gcrawfo@siue.edu) + +#Compiling: +Open root folder where `Makefile` is located. +Type `make` and the program should compile to the `./bin` folder + +#Usage: +bin/stuffy.out [-a | -l | -r | -e] [Archive Name] [Filename] > [Out Location] + +#Arguments: +[-a] -- Enter a specific number of producers + Ex: `bin/stuffy.out -a test/files/newstuffyarchive.test test/files/temp.test` + +[-l] -- List contents of [Archive Name] by `Name: [Filename] | Size: [Size]` + Ex: `bin/stuffy.out -l test/files/newstuffyarchive.test + +[-r] -- Remove [Filename] from [Archive Name] + Ex: `bin/stuffy.out -r test/files/newstuffyarchive.test test/files/temp4.test` + +[-e] -- Extract [Filename] data to stdout from [Archive Name] + Ex: `bin/stuffy.out -e test/files/newstuffyarchive.test test/files/temp3.test > test/files/output.test` + +#Testing: +A few functions are built in for testing +Try running `make test` | 8/8 Tests should pass diff --git a/src/stuffy.c b/src/stuffy.c index 89287ed..1601d9e 100644 --- a/src/stuffy.c +++ b/src/stuffy.c @@ -145,7 +145,7 @@ int IsFileArchived(char* archiveName, char* filename) { readSize = ReadSingleModuleFromArchive(archiveFD, &(module)); free(module.moduleData); - if (strcmp(module.moduleHeader.moduleName, filename) == 0) + if (strcmp(module.moduleHeader.moduleName, newFilename) == 0) { free(newFilename); close(archiveFD);