2 * BatchManager_Local_SH.cxx :
4 * Auteur : Ivan DUTKA-MALEN - EDF R&D
5 * Mail : mailto:ivan.dutka-malen@der.edf.fr
6 * Date : Thu Nov 6 10:17:22 2003
12 # include <SALOMEconfig.h>
19 #include <sys/types.h>
27 #include "Batch_IOMutex.hxx"
28 #include "Batch_BatchManager_Local_SH.hxx"
31 #error "RM undefined. You must set RM to a valid path to a rm-like command."
35 #error "CP undefined. You must set CP to a valid path to a cp-like command."
39 #error "SH undefined. You must set SH to a valid path to a sh-like command."
46 BatchManager_Local_SH::BatchManager_Local_SH(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException,ConnexionFailureException) : BatchManager_Local(parent, host)
51 BatchManager_Local_SH::~BatchManager_Local_SH()
56 // Methode qui renvoie la commande de copie du fichier source en destination
57 string BatchManager_Local_SH::copy_command(const string & host_source, const string & source, const string & host_destination, const string & destination) const
59 ostringstream copy_cmd;
60 copy_cmd << CP << " " << source << " " << destination;
61 return copy_cmd.str();
64 // Methode qui renvoie la commande a executer
65 string BatchManager_Local_SH::exec_command(Parametre & param) const
67 ostringstream exec_sub_cmd;
68 exec_sub_cmd << param[EXECUTABLE];
70 if (param.find(ARGUMENTS) != param.end()) {
71 Versatile V = param[ARGUMENTS];
72 for(Versatile::const_iterator it=V.begin(); it!=V.end(); it++) {
73 StringType argt = * static_cast<StringType *>(*it);
75 exec_sub_cmd << " " << arg;
79 param[ARGUMENTS] = "-c";
80 param[ARGUMENTS] += exec_sub_cmd.str();
85 // Methode qui renvoie la commande d'effacement du fichier
86 string BatchManager_Local_SH::remove_command(const string & host_destination, const string & destination) const
88 ostringstream remove_cmd;
89 remove_cmd << RM << " " << destination;
90 return remove_cmd.str();