› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › How easily to extract an IBDIR name from netconfig ?
In TCL, I need to extract the exactly IBDIR name in Netconfig file for a calling thread TCL proc. That is for an inbound thread, protocol = fileset-local OR fileset-ftp, PROPERTIES button of protocol : in Inbound section, I need to extract the Directory name I putted there in my setup because I want to use that path to do a copy of each reading files with ‘old’ extension. I tried before without success to do the copy without that path.
Thanks in advance
Ga
That would be nice if that information were avaiable during the Directory Parse UPoC.
What I use is a generic, reusable proc and it requires arguments giving the directory path for the inbound and where the copy should go.
If I could get the inbound directly, I could eliminate one argument (I would still need to know where the copy should go).
I refuse to use the unsupported mechanisms to interrogate the NetConfig and instead, continue to push Quovadx to publish a supported API to provide access into the various configuration files.
If you want to use them, there are some mechanisms which come with Cloverleaf(R) that allow you to navigate the NetConfig. That is all I know about them – others probably can give you more assitance there.
Thanks,
Jim Kosloskey
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
If you do a search on this form for “netcfgLoad” you should be able to find all kinds of related topics to those tcl procs.
I typically use a Directory Parse UPoC to check a file is stable prior to reading it and, as such, I need the full path to size it. My Directory Parse UPoC has a subroutine which reads the NetConfig to get the directory name.
If you just need the path in a TPS proc then get it from the metadata. If you need it in a Directory Parse UPoC, send me an e-mail and I’ll give you an example of how I do it. Or, better yet, attend the User’s Conference and I will provide lots of example procs.
Thanks a lot for your answer and I’m agree with you and I hope as your saying Jim, in a following release, Quovadx will publish a supported API to provide access into the various configuration files.
Jim, I’m exactly do the sameting than you with my Directory Parse UPoC for the same reasons. I like sample and functional solution.
Have a nice day,
Ga
Hi,
does anyone know if the problem with the missing IB-dir information in directory parse TPS has been fixed in V5.8?
I’m currently thinking about writing a directory parse TPS to make Cloverleaf rename any file to .tmp before reading it to avoid concurrent access of the writing system while cloverleaf still reads.
However – same problem as above – I can’t rename unless I have the full path to the files.
I tried to sample some metadata from an directory parse message in V5.8 but I still can’t find any suitable information on the IB directory.
Is there still no alternative to parsing the NetConfig?
Thanks!
Simone
Yes, full path is there now
Although I don’t have time to test it in an dir proc I don’t see way it won’t work. In the out bound I’ve used nfLoad to get the OBDIR value so I don’t have to hard code the directory where the file will be located.
set strNetConfig [file join $::HciSiteDir NetConfig]
nfLoad $strNetConfig arrProcessData arrHostData arrXlateData arrNetFilePrologue
set strOBDir [keylget arrHostData($::HciConnName) PROTOCOL.OBDIR]
Change OBDIR to IBDIR and that should get you the inbound directory name for the connection.
Hope this works for you.
John Mercogliano
Sentara Healthcare
Hampton Roads, VA
Yes, full path is there now
Hey Charlie,
that’s good news! Would you care to elaborate as to where I might find that piece of information?
Here’s a message dump of a V5.8.3 dir parse message:
msg: 0x02BBD088
msgType : DATA
msgClass : PROTOCOL
msgState : Unknown: 0 (0)
msgPriority : 5120
msgRecoveryDbState: Log:off (1)
msgFlags : 0x2
msgMid : [0.0.8]
msgSrcMid : midNULL
msgSrcMidGroup : midNULL
msgHostId : 874907791
msgOrigSrcThread :
msgOrigDestThread :
msgSrcThread :
msgDestThread :
msgXlateThread :
msgSkipXlate : 0
msgSepChars :
msgNumRetries : 0
msgGroupId : 0
msgDriverControl :
msgRecordFormat :
msgRoutes :
msgUserData :
msgStaticIsDirty : 0
msgVariableIsDirty: 0
msgTimeStartIb : 1310737171,004
msgTimeStartOb : 1310737171,004
msgTimeCurQueStart: 0,000
msgTimeTotalQue : 0,000
msgTimeRecovery : 1310737171,004
msgEoConfig : 0x00000000
msgData (BO) : 0x02BBD170
message : ‘txt_anfo2.txt txt_anfo3.txt txt_anfo4.txt txt_anfo5.txt txt_anfo6.txt’
I still get only a space separated list of filenames with no path information in either the message itself or the metadata.
Am I looking in the wrong places?
Thanks for any advice!
Simone
set strNetConfig [file join $::HciSiteDir NetConfig]
nfLoad $strNetConfig arrProcessData arrHostData arrXlateData arrNetFilePrologue
set strOBDir [keylget arrHostData($::HciConnName) PROTOCOL.OBDIR]
Hope this works for you.
Thanks John!
It works like a charm! (I tested it with IBDIR instead of OBDIR)
…but it still kinda feels like a hack…
I’d prefer having the engine handing over the information voluntarily rather than having to violently extract it from cloverleaf’s intestines .
😀
Geetings
Simone
set klst [msgmetaget $mh DRIVERCTL]
set filename “”; keylget klst FILENAME filename
The above will give you the full path. If you want just the file name do a file tail command
set klst [msgmetaget $mh DRIVERCTL]
set filename “”; keylget klst FILENAME filename
Sorry Charlie,
the above code just gives me empty stings. As you can see in the message dump I posted, there’s no DRIVERCTL information in the metadata whatsoever.
Maybe you’re thinking about IB-TPS-messages? Those definitely have the fields you mentioned. But it seems to me, for directory parse messages the information is still missing…
Greetings
Simone
You are correct. We cannot put in the DRIVERCTL until after the Directory Parse routine becuse, at that point, we don’t know which file to read.
Unfortunately the list provided to Directory Parse only has the names.
This might be a valid enhancment request to provide at least the directory name a t that point.
As someone else suggested, I simply read the NetConfig to get the directory
I don’t have my archived stuff with me right now but if you send me an e-mail I will be glad to send you a copy of the Directory Parse proc I use to verify a file is stable prior to fetching it