proc move2archive_argument { args } {keylget args MODE mode ;# Fetch modeswitch -exact -- $mode {start {return ""}run {# Get message handlekeylget args MSGID mh# get the user argumentsset uargs {} ; keylget args ARGS uargs ;# fetch user-supplied argumentsset arg_dest_dir "" ; keylget args ARGS.DESTDIR arg_dest_dir# Check for correct contextkeylget args CONTEXT ctxif {$ctx ne "fileset_ibdel"} {echo \nERROR proc used in wrong contextecho Context should be fileset_ibdelecho Proc called in: $ctx\nreturn "{CONTINUE $mh}"}# In this context the message handed to this proc# by the driver in not a data message. Rather# it is a list of file names from the directory# the fileset driver is configured to read.## The list of files to process is accessed# in the same way data messages in other contexts# are accessed.## The list is manipulated and returned## The fileset driver now processes the files in# order they appear in the returned message list.set msg_list [msgget $mh]set file_time_stamp [clock format [file mtime $msg_list] -format %Y%m%d%H%M%S]set current_date [clock format [clock seconds] -format %Y%m%d%H%M%S]set ofileid [open file_process.log a]puts $ofileid "$msg_list\t$file_time_stamp\t$current_date"close $ofileidecho \nmove2archive_argument: msg_list: $msg_list\nset destination_file $arg_dest_dir# echo \ndestination_file $destination_file\nfile rename -force $msg_list $destination_file# Put modified list in the message handlemsgset $mh $msg_listreturn {}}}}