?
Solved

Routing stdout to a file with Vignette - How to?

Posted on 2002-07-09
4
Medium Priority
?
590 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 200 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

Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

Question has a verified solution.

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

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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 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