CDV ❯ using %d in tc-config.xml to indicate client log location leads to creation of 2 directories
-
Bug
-
Status: Open
-
3 Minor
-
Resolution:
-
-
-
gkeim
-
Reporter: cfisher
-
February 27, 2007
-
0
-
Watchers: 0
-
March 10, 2010
-
Description
I used %d to indicate where to put client logs because I need to run multiple clients using the same tc-config.xml, and I noticed that %d behaves in a weird way:
Using this tc-config.xml with 2.2.1 kit results in creation of 2 directories:
/tmp/client/logs/terracotta*data (*=some number) /tmp/terracotta*data
The second directory is empty and the first one contains the expected log files.
Comments
Gary Keim 2007-02-27
Fiona OShea 2007-03-12
Can we fix this?
Gary Keim 2007-03-29
You can misuse %d by not using it as a prefix.
From looking at the code, %d means substitute the value of File.createTempDirectory(“terracotta”, “data”), which creates /tmp/terracotta*data. But then it should substitute that absolute pathname into the pattern you specify, which should have created /tmp/client/logs//tmp/terracotta*data.
There are several things wrong with com.tc.config.schema.dynamic.ParameterSubstitutor: (1) It should use everything prefixing %d as the directory in which to create the temporary subdirectory, using File.createTempDirectory(“terracotta”, “data”, new File(“/tmp/client/logs/”)). (2) the suffix “data” should be something like “tmp.” (3) After %d is used, if you try to use it again in another config path, it will retain the old value because it gets stored in a static.