From: abd Date: Thu, 14 Sep 2006 11:10:49 +0000 (+0000) Subject: Fix bug SWP12966 X-Git-Tag: Before_Merging_V3_2_0_maintainance_21Sep06~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=83970b6ec3e4626a0e507a9de68a0e8ab9e22cbe;p=modules%2Fvisu.git Fix bug SWP12966 Correct of using system calls --- diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index ce90dc65..b521461a 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -332,24 +332,13 @@ namespace VISU std::string aFile = aFileInfo.filePath().latin1(); if(theIsMultiFile){ aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName; - - - - //std::ostringstream aStream; -#ifndef WNT - QString aCommand( " cp %s %s%s " ); -#else - QString aCommand( " xcopy %s %s%s " ); -#endif - aCommand.arg( aFile ).arg( aTmpDir ).arg( aFileName ); - aCommand = QDir::convertSeparators( aCommand ); - -#ifdef WNT - aCommand += " /Y /R "; -#endif + QString aCommand; + aCommand.sprintf( " %s %s%s", aFile.c_str(), aTmpDir.c_str(), aFileName.c_str() ); + aCommand = QDir::convertSeparators( aCommand ); + aCommand.prepend( COPY_COMMAND ); - //printf( "VISU_Gen_i::Save %s", aCommand.latin1() ); + printf( "VISU_Gen_i::Save %s\n", aCommand.latin1() ); if(system(aCommand.latin1())){ INFOS("VISU_Gen_i::Save - Cann't execute the command :"<GetName()).c_str(); QString tmpDir = QDir::convertSeparators( QString(aTmpDir.ToCString()) );; static QString aCommand; -#ifndef WNT - aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1()); -#else - aCommand.sprintf("xcopy %s %s%s",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1()); -#endif + aCommand.sprintf(" %s %s%s",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1()); aCommand = QDir::convertSeparators( aCommand ); -#ifdef WNT - aCommand += " /Y /R"; -#endif - //printf( "VISU_Gen_i::SaveASCII %s ", aCommand.latin1() ); + aCommand.prepend( COPY_COMMAND ); + + printf( "VISU_Gen_i::SaveASCII %s \n", aCommand.latin1() ); if(system(aCommand.latin1())){ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<