Uuencode in a Tcl Script

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Uuencode in a Tcl Script

  • Creator
    Topic
  • #48886

    I have an interface that takes in a PDF, converts it to text, parses out data, and creates an outbound, xml-type message using the parsed data. I have to uuencode the original PDF and put the results in a ${pdf} tag in the outbound message.

    Is there a “best practices” way to do the uuencoding inside a tcl script?

    -- Max Drown (Infor)

Viewing 3 reply threads
  • Author
    Replies
    • #60005
      David Barr
      Participant
      • #60006

        How do I install that? (sorry for the noob question)

        -- Max Drown (Infor)

      • #60007
        David Barr
        Participant

          There are some general instructions here:

          http://wiki.tcl.tk/12099

          Basically, you download tcllib-1.9.tar.gz from the sourceforge.net download page (you can find it from http://tcllib.sourceforge.net/).  Put the file in a temporary location on your Cloverleaf system, then execute the following commands:

          Code:

          gzip -cd tcllib-1.9.tar.gz | tar xfv –
          cd tcllib-1.9
          hcitcl installer.tcl -no-apps -no-examples -pkg-path $HCIROOT/tcl/lib/tcllib1.9 -nroff-path $HCIROOT/tcl/man/mann

          After that, you can remove the TAR file and extracted files from your temporary location.

          I haven’t tested this very extensively.

          Another option, if you don’t want to go through all of the above, is to have your TCL code write your data out to a file and use the “exec” command to call the system “uuencode” command to encode the data.  Then, you can read the data back in to your TCL proc.  The code to do this probably won’t be as simple as using TCLLIB, but there is nothing extra that you would have to install to get it working.

          Also, if you upgrade Cloverleaf in the future, reinstalling this library will have to become part of your upgrade process.

        • #60008

          Thanks!

          Here is what I did ..

          Code:

          # uuencode the pdf document
          if {[catch {set docrBody [exec uuencode $ibdir/$fileName $ibdir/$fileName]} result]} {
             if {$debug} {puts “uuencode result: $result”}
             if {$debug} {puts “docrBody: $docrBody”}
          }

          Works perfectly.

          -- Max Drown (Infor)

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