From: Stephen Seo Date: Fri, 26 Jul 2024 07:23:50 +0000 (+0900) Subject: More verbose log when failing to create temp file X-Git-Tag: 1.0~18 X-Git-Url: https://git.seodisparate.com/stephenseo/css/brands.min.css?a=commitdiff_plain;h=4e6b2b8f5ab24495b8d855c21506689bc6036600;p=SimpleArchiver More verbose log when failing to create temp file --- diff --git a/src/archiver.c b/src/archiver.c index c1a7b97..a79f17a 100644 --- a/src/archiver.c +++ b/src/archiver.c @@ -202,6 +202,14 @@ int write_files_fn(void *data, void *ud) { fopen(temp_filename, "wb"); if (!tmp_fd) { fprintf(stderr, "ERROR: Unable to create temp file for compressing!\n"); +#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \ + SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \ + SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX + __attribute__((cleanup(free_malloced_memory))) void *real_cwd = + realpath(".", NULL); + fprintf(stderr, "Tried to create temp file(s) in \"%s\"!\n", + (char *)real_cwd); +#endif fprintf(stderr, "(Use \"--temp-files-dir \" to change where to write temp " "files.)\n");