proc renameFile { args } {
global HciConnName ;# Name of thread
keylget args MODE mode ;# Fetch mode
set ctx “” ; keylget args CONTEXT ctx ;# Fetch tps caller context
set uargs {} ; keylget args ARGS uargs ;# Fetch user-supplied args
set debug 0 ; ;# Fetch user argument DEBUG and
catch {keylget uargs DEBUG debug} ;# assume uargs is a keyed list
set module “renameTALX/$HciConnName/$ctx” ;# Use this before every echo/puts,
;# it describes where the text came from
set dispList {} ;# Nothing to return
switch -exact — $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
if { $debug } {
puts stdout “$module: Starting in debug mode…”
}
}
run {
# ‘run’ mode always has a MSGID; fetch and process it
keylget args MSGID mh
set timeVal [clock format [clock seconds] -format %m%d%y]
set new_out_file “FILE_${timeVal}_OUT.txt”
set dvr_ctl_str “{FILENAME $new_out_file}”
echo $new_out_file
msgmetaset $mh DRIVERCTL $dvr_ctl_str
lappend dispList “CONTINUE $mh”}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
shutdown {
# Doing some clean-up work
}
default {
error “Unknown mode ‘$mode’ in $module”
}
}
return $dispList
}
The inbound thread is fileset-local and the outbound is file-local, and I’ve placed the tclproc in the Outbound thread’s outbound tab under “TPS Outbound Data”. Just to confirm, I should expect the file name to write out to the process directory?