Experimental Physics and Industrial Control System
Hunt Steven wrote:
Ah, thinking about it doesn't dbLoadTemplate do the same (write to stdout,
and errors to stderr), I have this in a tcl catch { exec ...} call which
detects anything being written to stdout, so perhaps the problem is that the
error is not being detected by msi ??? as a test I added a ";" to a
template file (one of our most common errors). dbLoadTemplate seems to
catch this msi not.
msi is more generic than dbLoadTemplates and thus doesn't report the same errors
that dbLoadTemplate reported.
I will also suggest is that what is required is something that checks that
dbLoadDatabase will work on the file created by msi.
base has a test routine that could be used. It is located at
<base>/src/dbStatic/dbReadTest.c. It calls dbLoadDatabase for selected files and
reports errors if dbLoadDatabase fails and reports nothing if dbLoadDatabase
succeeds.
Examples: This should work with any version of base
cd <base>/bin/<arch>
Then create two files
test.db
record(ai,"test")
{
}
test1.db
record(ai,"test")
{
field(SCAN,"1 second")
}
record(ai,"test1")
{
field(JUNK,"xxxx")
}
Then the following happens
mercury% dbReadTest
usage: dbReadTest -Idir -Smacsub file.dbd file.db
mercury%
This is just to show what dbReadTest accepts as input.
mercury% dbReadTest -I ../../dbd ../../dbd/base.dbd ./test.db
mercury%
Since test.db was a valid file dbReadTest reported nothing.
mercury% dbReadTest -I ../../dbd ../../dbd/base.dbd ./test1.db
Error filename="../dbLexRoutines.c" line number=899
Field Not Found
Last token ")"
input line: field(JUNK,"xxxx")
in: file ./test1.db line 7
db_parse returned -1
For input file ./test1.dbfilename="../dbReadTest.c" line number=77
from dbReadDatabase
mercury%
Thus it reported an error.
I suspect you will want to start with dbReadTest and produce something more
compatible with your requirement.
Marty
- References:
- RE: msi vs dbLoadTemplate Hunt Steven
- Navigate by Date:
- Prev:
RE: msi vs dbLoadTemplate Hunt Steven
- Next:
CapFast update Dr. Chong Lee
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
<2003>
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
- Navigate by Thread:
- Prev:
RE: msi vs dbLoadTemplate Hunt Steven
- Next:
CapFast update Dr. Chong Lee
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
<2003>
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025