From 3e1e57db2775c49595b483e22589eb2e20015b14 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 16 Jan 2018 17:35:00 -0800 Subject: [PATCH] fix fileio progression status update The compression % is no longer correct, since it's no longer possible to make direct correlation between nb bytes read and nb bytes written due to large internal buffer inside CCtx (exacerbated with --long). The current "fix" is to no longer display the %. A more complex solution will have to count exactly how much data has been consumed and compressed internally, within CCtx buffers. --- programs/fileio.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index 58b77a813..326f0e673 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -809,21 +809,11 @@ static int FIO_compressFilename_internal(cRess_t ress, compressedfilesize += outBuff.pos; } } - if (g_nbThreads > 1) { - if (fileSize == UTIL_FILESIZE_UNKNOWN) - DISPLAYUPDATE(2, "\rRead : %u MB", (U32)(readsize>>20)) - else - DISPLAYUPDATE(2, "\rRead : %u / %u MB", - (U32)(readsize>>20), (U32)(fileSize>>20)); + if (fileSize == UTIL_FILESIZE_UNKNOWN) { + DISPLAYUPDATE(2, "\rRead : %u MB", (U32)(readsize>>20)); } else { - if (fileSize == UTIL_FILESIZE_UNKNOWN) - DISPLAYUPDATE(2, "\rRead : %u MB ==> %.2f%%", - (U32)(readsize>>20), - (double)compressedfilesize/readsize*100) - else - DISPLAYUPDATE(2, "\rRead : %u / %u MB ==> %.2f%%", - (U32)(readsize>>20), (U32)(fileSize>>20), - (double)compressedfilesize/readsize*100); + DISPLAYUPDATE(2, "\rRead : %u / %u MB", + (U32)(readsize>>20), (U32)(fileSize>>20)); } } while (directive != ZSTD_e_end);