fileset-local append file tcl

Clovertech Forums Cloverleaf fileset-local append file tcl

  • Creator
    Topic
  • #118427
    Stewart
    Participant

      How can I append the contents to the file instead of overwriting the file every time a new msg comes in?

       

      msgmetaset $mh DRIVERCTL “{FILESET {{OBFILE $new_name}}}”

    Viewing 4 reply threads
    • Author
      Replies
      • #118428
        Vince Angulo
        Participant

          As long as the $new_name variable does not change with every transaction, if you check “Append data” in the file protocol Outbound Properties, it should work.

        • #118429
          Keith McLeod
          Participant

            I concur.  I use things like the date from MSH.7 without the time as part of the filenaming.  By virtue of the date changing from the MSH.7 value, I get daily batches….that I can reproduce. And yes check append.

          • #118430
            Rob Abbott
            Keymaster

              Checking the box in the GUI is the best way, this will set the default to what you’re looking for.

               

              You can also control the append behaviour on a per-message basis by setting the FILSET.OBAPPEND key, e.g

               

              {FILESET {{OBFILE filename} {OBAPPEND 1}}}

              Rob Abbott
              Cloverleaf Emeritus

            • #118441
              Stewart
              Participant

                I had that checked in the properties.  However it still seems to be recreating the file.  I need a new file everyday and am naming on the date.  I’ve added the OBAPPEND as suggested to see if this will work.

                 

                set systemTime [clock seconds]
                set datetimestring [clock format $systemTime -format %Y%m%d]

                set new_name “”
                append new_name $name $datetimestring $suffix
                msgmetaset $mh DRIVERCTL “{FILESET {{OBFILE $new_name}{OBAPPEND 1}}}”
                lappend dispList “CONTINUE $mh”

              • #118442
                Charlie Bursell
                Participant

                  I have had better luck doing things like this using the upoc protocol in both the read and write mode with a timer.  Set the timer in the read mode to when name should change.  Simply add to the file in write mode using the append mode with the file command.

                  In the read mode, when triggered you could rename the file and even move completed file to another location.

              Viewing 4 reply threads
              • You must be logged in to reply to this topic.