From 83970b6ec3e4626a0e507a9de68a0e8ab9e22cbe Mon Sep 17 00:00:00 2001 From: abd Date: Thu, 14 Sep 2006 11:10:49 +0000 Subject: [PATCH] Fix bug SWP12966 Correct of using system calls --- src/VISU_I/VISU_Gen_i.cc | 49 ++++++++++++------------------------- src/VISU_I/VISU_I.hxx | 28 ++++++++++----------- src/VISU_I/VISU_Result_i.cc | 26 ++++++++++---------- 3 files changed, 42 insertions(+), 61 deletions(-) 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 :"<