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 :"<<aCommand);
continue;
QString aFileName = aPrefix + "_" + (pResult->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 :"<<aCommand);
continue;
aFileName += aFileInfo.fileName().latin1();
static QString aCommand;
string aFullFileName = aTmpDir + aFileName;
-#ifndef WNT
- aCommand.sprintf("cp %s %s",
-#else
- aCommand.sprintf("xcopy %s %s /Y /R",
-#endif
- QDir::convertSeparators( aFileInfo.filePath() ).latin1(),
- QDir::convertSeparators( aFullFileName.c_str()).latin1());
- //printf( " VISU_Gen_i::CopyFrom: %s", aCommand.latin1() );
- if(system(aCommand) == -1) {
+ aCommand.sprintf(" %s %s",aFileInfo.filePath(), aFullFileName.c_str() );
+ aCommand = QDir::convertSeparators( aCommand );
+ aCommand.prepend( COPY_COMMAND );
+
+ printf( " VISU_Gen_i::CopyFrom: %s\n", aCommand.latin1() );
+ if(system(aCommand.latin1()) == -1) {
if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<<aCommand);
return NULL;
}
#define _VISU_I_HXX_
#ifdef WNT
- #if defined VISU_I_EXPORTS
- #if defined WIN32
- #define VISU_I_EXPORT __declspec( dllexport )
- #else
- #define VISU_I_EXPORT
- #endif
- #else
- #if defined WIN32
- #define VISU_I_EXPORT __declspec( dllimport )
- #else
- #define VISU_I_EXPORT
- #endif
- #endif
+# if defined VISU_I_EXPORTS
+# define VISU_I_EXPORT __declspec( dllexport )
+# else
+# define VISU_I_EXPORT __declspec( dllimport )
+# endif
+# define COPY_COMMAND "copy /Y"
+# define MOVE_COMMAND "move /Y"
+# define DELETE_COMMAND "del /F"
#else
- #define VISU_I_EXPORT
+# define VISU_I_EXPORT
+# define COPY_COMMAND "cp"
+# define MOVE_COMMAND "mv"
+# define DELETE_COMMAND "rm -f"
#endif
+
+
#endif
\ No newline at end of file
if(mySourceId == eRestoredFile){
std::string aTmpDir(SALOMEDS_Tool::GetTmpDir());
static QString aCommand;
-#ifndef WNT
- aCommand.sprintf("cp %s %s",
-#else
- aCommand.sprintf("xcopy %s %s",
-#endif
- myFileInfo.absFilePath().latin1(),aTmpDir.c_str());
+ aCommand.sprintf(" %s %s", myFileInfo.absFilePath().latin1(), aTmpDir.c_str() );
aCommand = QDir::convertSeparators( aCommand );
+ aCommand.prepend( COPY_COMMAND );
-#ifdef WNT
- aCommand += " /Y /R";
-#endif
+ printf( " VISU::Result_i::Create %s \n", aCommand.latin1() );
- if(system(aCommand) == -1){
+ if(system(aCommand.latin1()) == -1){
MESSAGE("Create - Can't execute the command :"<<aCommand);
return NULL;
}
if (IsMultifile()) { // set this file as new - temporary
static QString aCommand;
- aCommand.sprintf("mv %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().latin1());
- if (system(aCommand) == -1) {
+ aCommand.sprintf(" %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().latin1());
+ aCommand = QDir::convertSeparators( aCommand );
+ aCommand.prepend( MOVE_COMMAND );
+ printf ( "VISU::Result_i::Restore %s\n", aCommand.latin1() );
+ if (system(aCommand.latin1()) == -1) {
if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand);
return NULL;
} else {
myFileInfo.setFile(QString(aResultPath) + QString(myFileInfo.baseName().latin1()));
} else { // change current temporary file to the new: with hdf-format
static QString aCommand;
- aCommand.sprintf("mv %s %s\0",aHDFFileName, myFileInfo.filePath().latin1());
+ aCommand.sprintf(" %s %s\0",aHDFFileName, myFileInfo.filePath().latin1());
+ aCommand = QDir::convertSeparators( aCommand );
+ aCommand.prepend( MOVE_COMMAND );
+ printf ( "VISU::Result_i::Restore %s\n", aCommand.latin1() );
if (system(aCommand.latin1()) == -1) {
if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand);
return NULL;