Solved

Routing stdout to a file with Vignette - How to?

Posted on 2002-07-09
4
584 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hibernate filter not working 4 106
SSRS producing multiple worksheets in EXCEL 2 250
TDBXValue only provides String values 8 234
VMWare environment audit 8 65
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…
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 …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 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