]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbi/bbiWeb.cxx
#3028 BBTK Bug New Normal - rights reading files in std
[bbtk.git] / kernel / appli / bbi / bbiWeb.cxx
index 360b135d45f5d1c595abf6b60992d5e525df000d..088433a036cd40937e299039074573f97411d7a6 100644 (file)
 int main(int argc, char* argv[])
 {
 
- printf("bbiWeb...1 argc=%d \n",argc);
+ printf("bbiWeb...A argc=%d \n",argc);
+
 //bbtk::MessageManager::SetMessageLevel("all",9);
 printf("bbiWeb: [0]: %s \n",argv[0]);
 printf("bbiWeb: [1]: %s \n",argv[1]);
- printf("bbiWeb...2\n");
+printf("bbiWeb: [2]: %s \n",argv[2]);
+printf("bbiWeb: [3]: %s \n",argv[3]);
+printf("bbiWeb: [4]: %s \n",argv[4]);
+ printf("bbiWeb...B\n");
 
 
   bbtk::WtBlackBox::wtServerData::argc = argc;
@@ -54,13 +58,25 @@ printf("bbiWeb: [1]: %s \n",argv[1]);
  
 
   bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
- printf("bbiWeb...3\n");
-//  std::string f(argv[1]);
-//  std::string f("/var/www/testwtdbg/docroot/.bbtk/tmp/testwt.bbs");
-  std::string f("/var/www/testwtdbg/docroot/.bbtk/tmp/demoPresentacion1Boton02.bbs");
- printf("bbiWeb...4\n");
-  I->InterpretFile(f);
- printf("bbiWeb...5\n");
+
+printf("bbiWeb...C\n");
+
+  std::string fileName = argv[0];
+  std::size_t pos      = fileName.find("_");     
+  fileName             = fileName.substr (pos+1);      
+  pos                  = fileName.find(".wt");
+  fileName             = fileName.erase (pos);  
+  fileName             = "bbs/"+fileName;
+
+printf("bbiWeb fileName %s\n", fileName.c_str() );
+//  std::string fileName("/var/www/testwtdbg/docroot/.bbtk/tmp/demoPresentacion1Boton02.bbs");
+
+
+
+
+ printf("bbiWeb...D\n");
+  I->InterpretFile(fileName);
+ printf("bbiWeb...E\n");
 
   return 0;
 }