fileset ftp protocol

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf fileset ftp protocol

  • Creator
    Topic
  • #47955
    William Grow
    Participant

      Hi,

        I am confused by the behavior of the fileset protocol thread in 5.3.  To begin this is an inbound thread that uses advanced scheduling. For the ftp protocol the following has been set up:

      Fileset options

      read interval 300 (default)

      max messages 1 (default)

      use advamced scheduling (checked)

        setup

           description – <>

           seconds – 0

            minutes – 0

            hours – 17

            day of month – *

            months – *

            day of week – *

        ftp options

            login – <>

            password  – <>

            info – blank

            inbound dir -/<>

           read time – 5

           pulse time – 500

           close connection after write – checked

           delay connection until needed -checked

           data type – image/binary

            ftp host information

                 – host <>

                 – port ftp

      I am not using a parse script because there should be only a single file in the directory.   The confusion that I am having is resulting from the way the thread starts up.  When the thread is started it changes from down to up.  It then goes into an error state for a short while, and then the status changes to timer.  When I checked the logs, it appears that the thread is trying to read several subdirectories in the ftp folder as if they are files.  The error message here is :

      FTP command ‘RETR <>^M’ failed: ‘550

      The system cannot find the file specified. ^M

      I was used to the ftp protocol ignoring any subdirectories and I am unsure of why the thread goes into an error state when it is first started and why it appears to be trying to pick up subdirectories.  Is this the way that it is supposed to work? Should I be trying to parse the directory the file that I need is in and telling the ftp thread to ignore the subdirectories?

    Viewing 3 reply threads
    • Author
      Replies
      • #57153
        James Cobane
        Participant

          William,

          I believe the issue is with the sub-directories where the engine is looking to pick-up the file.  When the thread goes to read the directory for the existence of files, the sub-directories are passed as part of the list of files in that directory.  Your best bet is to either:

          A) Add a directory parse proc to only look for certain files  (i.e. *.DAT, or whatever), thus the directories will be excluded.  There is a fileset_dir_parse.tcl proc in the $HCIROOT/contrib directory that you can copy and use.

          or

          B) have the file placed in a directory that has no sub-directories

          Hope this helps.

          Jim Cobane

          Henry Ford Health

        • #57154
          William Grow
          Participant

            Thanks a-lot. I didn’t think that anyone was going to reply to this post. The parse script location mention helped out a lot.

          • #57155
            Jim Kosloskey
            Participant

              Bill,

              There is a Tcl command which will allow you to determine if a file is a directory.

              You could use the comand in the parse proc to determine which entries are directories and eliminate them from the list.

              I am on vacation so unfortunately otherwise I would have looked up the command.

              If you are interested but unable to locate the command let me know and I will see if I can locate it.

              Jim Kosloskey

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            • #57156
              Rentian Huang
              Participant

                William, you can try this, I use it to filter files. Put it in the Directory Parse.

                sam 🙂

                ===================================

                proc tpsFilesetFilter { args } {

                keylget args MODE mode

                keylget args CONTEXT context

                if {![keylget args ARGS.DEBUG debug]} { set debug “0” }

                if {![keylget args ARGS.FILTER filter]} { error “No filter argument provided” }

                set dispList {}

                switch -exact — $mode {

                start {}

                run {

                keylget args MSGID mh

                set data [msgget $mh ]

                set return_files {}

                foreach file $data {

                if [string match $filter $file] {

                lappend return_files $file

                }

                }

                msgset $mh $return_files

                lappend dispList “CONTINUE $mh”

                }

                shutdown {}

                time {}

                default {

                error “Unknown mode ‘$mode’ in tps_fileset_dir_parse”

                }

                }

                return $dispList

                }

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