5.6.2 RedHat 4.0 – Problem With exec Within tcl

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf 5.6.2 RedHat 4.0 – Problem With exec Within tcl

  • Creator
    Topic
  • #50768
    Bob Moriarty
    Participant

    Greetings,

    Moving from 5.3.2 on RedHat 3.0 to 5.6.2 on RedHat 4.0.

    I’ve noticed that tcl now complains when exec-ing a PostScript-to-PDF file conversion utility in /usr/bin. A converted file does get created but tcl reports an error.  Running the utility from the commandline shows no error. Both of the output PDFs are viewable but they differ in length by one byte.

    This worked OK in 5.3.2 on RedHat 3.0

    TIA for thoughts or solutions.

    #>ls -l 123.ps

    -rw-r–r–  1 hci staff 13762 Apr  3 10:26 123.ps

    #>tcl

    tcl>exec convert 123.ps aaa.pdf

    Error: child process exited abnormally

    tcl>exit

    #>ls -l aaa.pdf

    -rw-rw-r–  1 hci staff 46881 Apr  3 10:38 aaa.pdf

    #>convert 123.ps bbb.pdf

    #>ls -l [ab]*.pdf

    -rw-rw-r–  1 hci staff 46881 Apr  3 10:38 aaa.pdf

    -rw-rw-r–  1 hci staff 46880 Apr  3 10:39 bbb.pdf

    #>diff aaa.pdf bbb.pdf

    Binary files aaa.pdf and bbb.pdf differ

Viewing 2 reply threads
  • Author
    Replies
    • #67449
      David Barr
      Participant

      Your script is probably exiting with a non-zero result code.  There are some TCL variables you can look at to see the cause of the exec failure.  You can also check the exit status of your script when you run it outside of TCL.

      Code:

      $ hcitcl
      hcitcl>exec ./test.sh
      Error: child process exited abnormally
      hcitcl>echo $errorCode
      CHILDSTATUS 16872 1
      hcitcl>exit
      $ ./test.sh
      $ echo $?
      1
      $

    • #67450
      David Barr
      Participant

      Also, I’m not sure if this “convert” script is something that you guys wrote.  It might be the “convert” command from ImageMagick.  You could try using the “-verbose” flag to see if it prints any messages about abnormal activity.

    • #67451
      Bob Moriarty
      Participant

      Thanks for the suggestions David.

      Yes, this is the ImageMagick convert. And yes, using your code I can see a non-zero exit code in both the unix and tcl shells.

      Thanks much!

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

Forum Statistics

Registered Users
5,119
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10