Solved

Routing stdout to a file with Vignette - How to?

Posted on 2002-07-09
4
585 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Switching from Oracle Weblogic to JBoss 2 218
Install SCCM to client machine 3 139
Symantec backup exec 2014 vs Arcserve application 1 301
MQ websphere create mq failing AMQ6239 7 352
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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