]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Issue 0020448: Put the omniNames log files in a subdir
authorvsr <vsr@opencascade.com>
Tue, 18 Aug 2009 10:36:56 +0000 (10:36 +0000)
committervsr <vsr@opencascade.com>
Tue, 18 Aug 2009 10:36:56 +0000 (10:36 +0000)
bin/nameserver.py

index 32fa88627c868f4b99e9fe506836df53de0acc5d..e4ae95334011ef4ded35708a30f82c8a70a8f5d0 100755 (executable)
@@ -63,14 +63,6 @@ class NamingServer(Server):
           #print "Can't create " + upath
           pass
 
-        #os.system("touch " + upath + "/dummy")
-        for fname in os.listdir(upath):
-          try:
-            if not fname.startswith("."): os.remove(upath + "/" + fname)
-          except:
-            pass
-        #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log")
-
         if verbose(): print "Name Service... ",
         #hname=os.environ["HOST"] #commands.getoutput("hostname")
         if sys.platform == "win32":
@@ -89,6 +81,27 @@ class NamingServer(Server):
         #aPort=(ss.join().split(':'))[2];
         #aPort=re.findall("\d+", ss[0])[0]
 
+        # \begin{E.A.}
+        # put the log files of omniNames in different directory with port reference,
+        # it is cleaner on linux and it is a fix for salome since it is impossible to
+        # remove the log files if the corresponding omniNames has not been killed.
+        # \end{E.A.}
+        
+        upath += "/omniNames_%s"%(aPort)
+        try:
+           os.mkdir(upath)
+        except:
+           #print "Can't create " + upath
+           pass
+        
+        #os.system("touch " + upath + "/dummy")
+        for fname in os.listdir(upath):
+          try:
+             os.remove(upath + "/" + fname)
+          except:
+            pass
+        #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log")
+
         #aSedCommand="s/.*NameService=corbaname::" + hname + ":\([[:digit:]]*\)/\1/"
         #print "sed command = ", aSedCommand
         #aPort = commands.getoutput("sed -e\"" + aSedCommand + "\"" + os.environ["OMNIORB_CONFIG"])