|
From: kwikius <kw...@ya...> - 2016-01-23 15:15:10
|
// Mingw32/msys version of Unzip unzips the file ok from the command line but not when called from in an app using "system(xx)" command // Here is a program that demonstrates the problem // Zip was originally downloaded from here.. //http://downloads.sourceforge.net/project/freertos/FreeRTOS/V8.2.3/\ FreeRTOSV8.2.3.zip (// N.B. This behaviour also shows up with other large zip files) #include <cstdlib> // The app Works fine with GNUWin32 version of unzip //const char* cmd = "C:/Gnuwin32/bin/unzip.exe \ C:/cpp/temp/FreeRTOSV8.2.3.zip -d C:/cpp/air_lib"; // but with Mingw/Msys version, during/after unzipping I get // error: zipfile probably corrupt (segmentation violation) const char* cmd = "C:/MinGW/msys/1.0/bin/unzip.exe \ C:/cpp/temp/FreeRTOSV8.2.3.zip -d C:/cpp/air_lib"; int main() { system (cmd); } ---------- version info ----------- $ uname -a MINGW32_NT-6.2 ANDYPC2 1.0.18(0.48/3/2) 2012-11-21 22:34 i686 Msys _mingw.h #define __MINGW32_VERSION 3021000L #define __MINGW32_MAJOR_VERSION 3 #define __MINGW32_MINOR_VERSION 21 #define __MINGW32_PATCHLEVEL 0 $ ld -v GNU ld (GNU Binutils) 2.25.1 $ gcc -v Using built-in specs. COLLECT_GCC=C:\MinGW\bin\gcc.exe COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto- wrapper.exe Target: mingw32 Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 - -build=m ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld -- enable-lto --enable-libssp --disable-multilib --enable- languages=c,c++,fortran,objc,obj-c++ ,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry -- enable-l ibstdcxx-debug --enable-version-specific-runtime-libs --with- gmp=/usr/src/pkg/gm p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32- src/bld -- with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes - -enable- libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl- prefix=/ mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T Thread model: win32 gcc version 4.8.1 (GCC) |