From 877fe447204cc43bed144d0e6a39521c0cc5816c Mon Sep 17 00:00:00 2001 From: Matteo Paonessa Date: Sun, 10 May 2015 19:51:50 +0200 Subject: [PATCH] lesser changes --- lossless.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lossless.c b/lossless.c index 9cb0e83..81f8207 100755 --- a/lossless.c +++ b/lossless.c @@ -53,6 +53,14 @@ int cclt_optimize(char* input_file, char* output_file) { //We don't need the input file anymore fclose(fp); + + //Create the output path if does not exists + if (mkdir(pars.output_folder, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1) { + if (errno != EEXIST) { + perror("mkdir"); + exit(-5); + } + } //Open the output one instead fp = fopen(output_file, "w+");