X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_MGLicenseKeyGen.cxx;h=1b5655e0c934686e5ab8345af3295ed7d473af85;hp=c86bad807ba73776683187f5556b06212642e422;hb=dacd89c7dfc779f4a8249ff08ca15f7b963408a5;hpb=f4764708fe85e2b2ef298edb8e392e2540564cd1 diff --git a/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx b/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx index c86bad807..1b5655e0c 100644 --- a/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx +++ b/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx @@ -275,7 +275,7 @@ namespace std::string outFile = tmpDir + "libMeshGemsKeyGenerator.so"; - std::string cmd = "wget " + url + " -O " + outFile; + std::string cmd = "smesh_wget.py " + url + " -O " + outFile; #endif @@ -289,8 +289,34 @@ namespace } } +#ifndef WIN32 + //[EDF25906] + std::string redirect = tmpDir + "redirect.out"; + std::ostringstream oss; + oss << cmd << " " << redirect; + cmd = oss.str(); +#endif + system( cmd.c_str() ); // download +#ifndef WIN32 + {//[EDF25906] + std::ifstream infile(redirect); + infile.seekg(0, std::ios::end); + size_t length = infile.tellg(); + infile.seekg(0, std::ios::beg); + std::unique_ptr buffer(new char[length+1]); + buffer[length] = '\0'; + infile.read(const_cast( buffer.get() ),length); + + MESSAGE( buffer.get() ) + } + { + SMESH_File redirectFile( redirect, /*open=*/false ); + redirectFile.remove(); + } +#endif + SMESH_File resultFile( outFile, /*open=*/false ); bool ok = ( resultFile.exists() && resultFile.size() > 0 );