fileset-ftp Outbound file name

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf fileset-ftp Outbound file name

  • Creator
    Topic
  • #54303
    Dustin Sayes
    Participant

      My issue : naming the FTP file, outbound.

      for testing I am keeping my tcl very simple.

      here it is:

      Code:


      set msg [msgget $mh]

      msgmetaset $mh DRIVERCTL “FileNameHere.txt”

      lappend dispList “CONTINUE $mh”

      With this, I can do msgdump and see that the metadata is successfully changed and reflects the “FileNameHere.txt”

      From what I understand, this should affect the outbound file name.

      In the “FTP Protocol Properties” window, “Fileset Options” tab, “Outbound” panel, “File:” text box – I place a value “whatever.txt”

      The value from this text box is naming my file. But I do not want this action.

      My .tps is on the “TPS Outbound Data:”

      My ultimate goal is to alter the file name, on the FTP Outbound…

      I have scoured the forms, looked at many procs and from what I can tell, altering the metadata should alter the file name, but the value from the engine is overwriting the meta data.

      Any suggestions?

    Viewing 6 reply threads
    • Author
      Replies
      • #80945
        Dustin Sayes
        Participant

          the darnedest thing… every time I post on here, I fix my issue 5 minutes later… and I have been looking at this for a few days off and on.

          My issue…

          I was not using the OBFILE..

          I implemented something like this:

          Code:


          keylset fileKeys OBFILE “MyFile”

          I presume it was the OBFILE command that I was missing and misusing..

        • #80946
          Charlie Bursell
          Participant

            Still not quite right.  Try this:

            keylset klst FILESET.OBFILE  $myname

            msgmetaset $mh DRIVERCTL $klst

            All of the keys are listed in the docs

          • #80947
            Dustin Sayes
            Participant

              Hi Charlie, thanks a ton for the post!!

              I wanted to share my code with the community – thank you all for you help.


              proc tpsCIIS_vxu { args } {

              [code]
              proc tpsCIIS_vxu { args } {

            • #80948
              Charlie Bursell
              Participant

                If you are doing a lot of messages here you will lose some.  The engine can send more than one in a second giving you duplicate filenames which will be over-written.

                Use a counter

              • #80949
                Dustin Sayes
                Participant

                  Thanks for the advice Charlie.

                  Do you think I need some code check for existing file name before I send? This is an FTP thread…

                  In my testing I simply initialize the counter in startup, then in run I do CtrNextValue, then set the CtrCurVal to a variable then append to file name.

                  Do you think this is sufficient or do I need some kind of check?

                  if {! [file exist CIISCtr.ctrl]} {

                  CtrInitCounter CIISCtr 1 999 1

                  }

                • #80950
                  Charlie Bursell
                  Participant

                    Just do the counter anyway

                    In the start portion of your proc:

                    if {![file exists $::HciConnName.ctr]} {

                         CtrInitCounter $::HciConnName  1111 9999 1111

                    }

                    Then when you build the file name:

                    set cnt [CtrNextValue $::HciConnName]

                    set FileName $Suffix$TimeStamp$cnt$FileExt

                    Note in start you *MUST*  make sure the counter file does not exist before initializing it.  Otherwise you will again have duplicate file names

                    Note the counter counts from 1111 to 9999.  Coupled with the timestamp that is plenty.  Also I like to give counters the name of the thread so when I see the file I know who it is for.   You could put a dot (.) in front to make it hidden.

                  • #80951
                    Dustin Sayes
                    Participant

                      Thanks Charlie! It works like a charm.

                      I updated the code in my prior post in case this can be helpful for anyone else.

                  Viewing 6 reply threads
                  • The forum ‘Cloverleaf’ is closed to new topics and replies.