Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Routing stdout to a file with Vignette - How to?

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

610 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