Solved

Routing stdout to a file with Vignette - How to?

Posted on 2002-07-09
4
577 Views
Last Modified: 2009-01-06
Hi,

I'm building a CMA and I would like to make use of the htmlparse package supplied with Tcllib 1.0.

Just wrote a little testprogram and I get an error straight away (see below).

My question is, who do I setup Vignette to route standard output to a file?

Kind Regards
// Anders Karlsson

-----------------------------------------------------------------------
error writing "stdout": bad file number
    while executing
"puts "==> $args""
    (procedure "::htmlparse::debugCallback" line 3)
    invoked from within
"::htmlparse::debugCallback {hmstart} {} {} {}"
    ("eval" body line 1)
    invoked from within
"eval "$cmd {$vroot} {} {} \{$html\}""
    (procedure "htmlparse::parse" line 75)
    invoked from within
"htmlparse::parse $test_html"
    invoked from within
"set p_test_html -incvar inc_tags [htmlparse::parse $test_html]"
-----------------------------------------------------------------------
0
Comment
Question by:Ruskin
4 Comments
 
LVL 1

Expert Comment

by:hooker042299
ID: 7149445
From looking at a tcl reference book, I can summarise and summise as follows:

1. the syntax of "puts" is as follows:
puts ?-nonewline? ?channel? outputString

2. "I/O is done via channels. A channel is accessed via handles which are returned by certain commands."

3. open a channel to a file using the open command:
open fileName ?access? ?permissions?

Is this any use?
0
 
LVL 1

Accepted Solution

by:
EliteKiller earned 100 total points
ID: 7298864
regards, you question was not answered.
0
 
LVL 24

Expert Comment

by:SunBow
ID: 7300268
more foul tongue?
how quaint.
<snore>
0
 

Expert Comment

by:stefanvogel
ID: 9649646
Hi Ruskin,

you don't need to redirect the stdout to a file. As far as I know the output to stdout from htmlparse is just "debug"-info. You can simply delete the "puts"-statements.

If you have other applications using puts you might want to "overload" puts. You can insert something like the following in your delivery.tcl file (UNTESTED!)

rename puts _original_puts
proc puts {args} {
  # determine arguments, check if output-channel is stdout
  # maybe the parameter "-nonewline" was specified...

  if {<output-channel is stdout} {
    set fd [open <your-file> a]
    uplevel _original_puts $fd $args
    close $fd
  } else {
    uplevel eval _original_puts $args
  }
}


But I doubt you want to have all those stuff in a file. And deleting the puts is easier :-)
Best regards
  Stefan
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now