@return : 0 == ok; 1 == pb with src file. */
int FIO_decompressFilename (const char* outfilename, const char* infilename, const char* dictFileName);
+int FIO_listFile(const char* infilename);
/*-*************************************
* Multiple File functions
DISPLAY( " -v : verbose mode; specify multiple times to increase verbosity\n");
DISPLAY( " -q : suppress warnings; specify twice to suppress errors too\n");
DISPLAY( " -c : force write to standard output, even if it is the console\n");
+ DISPLAY( " -l : print information about zstd compressed files.\n");
#ifndef ZSTD_NOCOMPRESS
DISPLAY( "--ultra : enable levels beyond %i, up to %i (requires more memory)\n", ZSTDCLI_CLEVEL_MAX, ZSTD_maxCLevel());
#ifdef ZSTD_MULTITHREAD
}
-typedef enum { zom_compress, zom_decompress, zom_test, zom_bench, zom_train } zstd_operation_mode;
+typedef enum { zom_compress, zom_decompress, zom_test, zom_bench, zom_train, zom_list } zstd_operation_mode;
#define CLEAN_RETURN(i) { operationResult = (i); goto _end; }
argument++;
memLimit = readU32FromChar(&argument);
break;
-
+ case 'l': operation=zom_list; argument++; break;
#ifdef UTIL_HAS_CREATEFILELIST
/* recursive */
case 'r': recursive=1; argument++; break;
}
}
#endif
-
+ if(operation==zom_list){
+ DISPLAY("===========================================\n");
+ DISPLAY("Printing information about compressed files\n");
+ DISPLAY("===========================================\n");
+ unsigned u;
+ DISPLAY("Number of files listed: %d\n", filenameIdx);
+ for(u=0; u<filenameIdx;u++){
+ FIO_listFile(filenameTable[u]);
+ }
+ CLEAN_RETURN(0);
+ }
/* Check if benchmark is selected */
if (operation==zom_bench) {
#ifndef ZSTD_NOBENCH