f



Dose there any tcl script to translate an file with embedded tcl

Hi
I need to generate some big file, but there are rules for generate
these files
Ex .
==============================
Start
input a [0] wire
input a [1] wire
..
..
..
..
input a [1000] wire
End
=================================

Dose there any tcl script can help to translate a file with  embedded
tcl script into a new file
For example

this is a source file
========================
Start
*  set i 0
*  for { set i 0 } { $i < 1000 } { incr i } {
*  puts input a [$i] wire
* }
End
==========================

After Translate
=======================
Start
input a [0] wire
input a [1] wire
..
..
..
..
input a [1000] wire 
End
=======================

0
deanhuang (2)
7/5/2005 7:15:43 AM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

3 Replies
857 Views

Similar Articles

[PageSpeed] 57

Gogo12 wrote:
> 
> Hi
> I need to generate some big file, but there are rules for generate
> these files
> Ex .
> ==============================
> Start
> input a [0] wire
> input a [1] wire
> .
> .
> .
> .
> input a [1000] wire
> End
> =================================
> 
> Dose there any tcl script can help to translate a file with  embedded
> tcl script into a new file
> For example
> 
> this is a source file
> ========================
> Start
> *  set i 0
> *  for { set i 0 } { $i < 1000 } { incr i } {
> *  puts input a [$i] wire
> * }
> End
> ==========================
> 
> After Translate
> =======================
> Start
> input a [0] wire
> input a [1] wire
> .
> .
> .
> .
> input a [1000] wire
> End
> =======================

That ought to be easy:

set infile [open "my_file_with_embedded_scripts" "r"]
set copy 0 
while { [gets $infile line] >= 0 } { 
    if { $line == "Start" } {
        set script ""
        set copy 1 
    }
    if { $line == "End" } {
        set copy 0
        eval $script
    }
    if { $copy } {
        append script "[string range $line 1 end]\n"
    }
}
close $infile

(I have modelled this after your example, however:
change the line "puts ..." to:

   puts "input a \[$i\] wire"

to avoid Tcl errors ;)

Regards,

Arjen
0
arjen.markus (2628)
7/5/2005 8:25:13 AM
Thanks for your help Arjen ^__^

I have find a more flexible one
but it's write in Perl
it's called perl preporcessor
here is the link

It's writen by Iain McClatchie
here is the link
http://www2.killian.com/earl/download/perl/bin/perlpp

I am not so familiar with Perl
Does any one small tcl scripts can do well as the Perl scripts does?

0
deanhuang (2)
7/7/2005 2:34:03 AM
In article <1120703643.840521.156880@o13g2000cwo.googlegroups.com>,
Gogo12 <deanhuang@globalunichip.com> wrote:
>Thanks for your help Arjen ^__^
>
>I have find a more flexible one
>but it's write in Perl
>it's called perl preporcessor
>here is the link
>
>It's writen by Iain McClatchie
>here is the link
>http://www2.killian.com/earl/download/perl/bin/perlpp
>
>I am not so familiar with Perl
>Does any one small tcl scripts can do well as the Perl scripts does?
>

I don't understand the question.  I wonder whether 
<URL: http://wiki.tcl.tk/2084 > answers it.
0
claird (2363)
7/10/2005 4:08:02 PM
Reply:

Similar Artilces:

Sourcing a TCL file from within a tcl file
I am a newbie which I am sure I don't need to state :) I am trying to create a variable with a TCL file that will source another tcl file when I type the variable name something like this if I enter A through my keyboard then source a.tcl Can someone show me how to do this thanks guy On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote: > I am a newbie which I am sure I don't need to state :) > > I am trying to create a variable with a TCL file that will source > another tcl file when I type the variable name > > something like this > > if I enter A through my keyboard =A0then source a.tcl > > Can someone show me how to do this > > thanks > guy What you are asking is not hard. Will your program have a graphical user interface? Aric On Dec 10, 3:26=A0pm, Aric Bills <aric.bi...@gmail.com> wrote: > On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote: > > > I am a newbie which I am sure I don't need to state :) > > > I am trying to create a variable with a TCL file that will source > > another tcl file when I type the variable name > > > something like this > > > if I enter A through my keyboard =A0then source a.tcl > > > Can someone show me how to do this > > > thanks > > guy > > What you are asking is not hard. =A0Will your program have a graphical > user interface? > > Aric no I am just using this script...

tcl-pam: PAM authentication for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-pam Tcl-pam is a Tcl interface to the PAM* service of Linux. It provides a Tcl package that allows Tcl scripts to use PAM to authenticate users and programs. It relies on linux-pam library: http://www.kernel.org/pub/linux/libs/pam/ * PAM (Pluggable Authentication Modules): A mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API). This enables programs that rely on authentication to be written independently of the underlying authentication scheme. Platform: Linux Home page: http://sourceforge.net/projects/tcl-pam/ Man page: http://tcl-pam.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For an introduction to genetic algorithms visit: http://gaul.sourceforge.net/intro.html Platform: Linux (GAUL library dependency) Home page: http://sourceforge.net/projects/tcl-gaul/ Man page: http://tcl-gaul.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Does anyone have a Tcl Script which does a Multi Part File Upload to web site ( TCL CGI )
Hello all, I am after a Tcl script which I can use on my apache Linux server which a user can upload files or pictures to the site with ... Any help is appreciated, Thank you for the help, Sean - HeliHobby.com Sean wrote: > Hello all, > > I am after a Tcl script which I can use on my apache Linux server > which a user can upload files or pictures to the site with ... > > Any help is appreciated, > > Thank you for the help, > > Sean - HeliHobby.com I use ncgi for ths (from tcllib). It rocks! high quality code that never fails. For instance the file upload of wiki.hping.org is implemented in this way. Ciao, antirez ...

Tcl command to evaluate a tcl script?
Hi all, I need to evaluate a separate tcl file within a tcl file. Is there any tcl command to evaluate a tcl file ? Regards, Prabu.K prabu wrote: > Hi all, > > I need to evaluate a separate tcl file within a tcl file. Is there any > tcl command to evaluate a tcl file ? > > Regards, > Prabu.K > hi, try: source your_other_tcl_file.tcl cheers, Tobi ...

tcl-mq: POSIX Message Queues for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mp Tcl-mp is a Tcl interface to POSIX Message Queues*. It provides a Tcl package that allows scripts to create/open/close/unlink multiple parallel message queues, and to send/receive messages synchronously and asynchronously to/from them. * A POSIX message queue is an Inter-Process Communication mechanism available on Linux and some other POSIX-compliant operating systems. It allows to or more processes (or threads) to communicate under the same OS. The messages are buffered by the kernel, which gives them kernel persistency. A message queue can be thought of as a linked list of messages. Threads with adequate permission can put messages onto the queue, and threads with adequuate permission can remove messages from the queue. Each message is assigned a priority by the sender, and the oldest message of highest priority is always retrieved first. Unlike PIPES and FIFOS, no requirement exists that someone be waiting for a message to arrive on a queue, before some process writes a message to that queue. It's not even a requirement for both processes to exist at the same time. Read mq_overview(7) for more details Platform: Linux Home page: http://sourceforge.net/projects/tcl-mp/ Man page: http://tcl-mp.sourceforge.net/ Author: Alexandros Stergiakis alsterg On Sep 3, 11:37=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl pro...

tcl-mmap: A POSIX mmap interface for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mmap Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides a Tcl package that allows Tcl scripts to: 1) Memory map files for improved access efficiency; 2) Share memory between related processes; 3) Easily implement cyclic persistent log files. * See the mmap(2) man page. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-mmap/ Man page: http://tcl-mmap.sourceforge.net/ Author: Alexandros Stergiakis On Sep 3, 11:48=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl project: tcl-mmap > > Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides > a Tcl package that allows Tcl scripts to: 1) Memory map files for > improved access efficiency; 2) Share memory between related processes; > 3) Easily implement cyclic persistent log files. > > * See the mmap(2) man page. > Great to see this and the other packages you made. Looking at the manpage it looks a bit misformatted before the usage example. Any specific reason to use GPL for this instead the usual Tcl/MIT/BSD style license used? Michael schlenk wrote: > On Sep 3, 11:48 am, Alexandros Stergiakis <alst...@gmail.com> wrote: >> This is an announcement for a relatively new Tcl project: tcl-mmap >> >> Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides >> a Tcl package that...

tcl-syslog: Unix system logging for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-syslog Tcl-syslog is a Tcl interface to the *nix syslog service. It provides a Tcl package that allows Tcl scripts to log messages to syslog. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-syslog/ Man page: http://tcl-syslog.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Tcl command to evaluate a tcl script? #2
Hi all, I need to evaluate a separate tcl file within a tcl file. Is there any tcl command to evaluate a tcl file ? Regards, Prabu.K prabu wrote: > I need to evaluate a separate tcl file within a tcl file. Is there any > tcl command to evaluate a tcl file ? You're probably looking for the "source" command. Other commands of interest would be "package require" or "eval". The command "load" is for binary shared libraries. -- Darren New / San Diego, CA, USA (PST) Scruffitarianism - Where T-shirt, jeans, and a three-day beard are "Sunday Best." Thanks Darren. But what my need is that I am writing a tcl script which is going to take any tcl script as input and should return the output of the file. How can I do that? Regards, Prabu Darren New wrote: > prabu wrote: > > I need to evaluate a separate tcl file within a tcl file. Is there any > > tcl command to evaluate a tcl file ? > > You're probably looking for the "source" command. > > Other commands of interest would be "package require" or "eval". The > command "load" is for binary shared libraries. > > -- > Darren New / San Diego, CA, USA (PST) > Scruffitarianism - Where T-shirt, jeans, > and a three-day beard are "Sunday Best." On 17 Dec 2006 21:16:16 -0800, "prabu" <catchme.prabu@gmail.com> wrote: > Thanks Dar...

tcl-snmptools: SNMP v1/v2/v3 operations for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-snmptools Tcl-snmptools is a Tcl interface to the Net-SNMP library which provides operations for the management of remote SNMP agents. It supports all the standard SNMP v1/v2/v3 operations: connect, close, get, set, getnext, walk, bulkget, bulkwalk, trap, translate and others. It is currently in a functional state, but more work and testing needs to be done. Home page: http://sourceforge.net/projects/tcl-snmptols/ Man page: http://tcl-snmptols.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Opening a TCL program from within another TCL program in ANSYS Tcl-Tk
Hi everyone, I have been pulling my hair with this one for a couple of days and still have not found a fix. I'm working within ANSYS Tcl-Tk implementation. I created a Tcl-Tk script that generates a simple window with three buttons. Each button opens another window which is created in a separate Tcl file. The second window have a lot of text entries, variables, procedures, etc. I can open the second Tcl file by itself and everything works as supposed, but when I open it using the button in the first window, it opens but any procedure called by the widgets on the second window are not found... Here's the deal... Since I'm working within the ANSYS implementation of Tcl-Tk, I'm actually using an ANSYS command to open the second window. The command I use is: ### ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' ### It actually sends a command back to ANSYS telling it to execute a Tcl command... I know this is not pretty but its the only way i was able to make it at least show the window. ############################## #Main Tcl (excerpt): ############################## namespace eval Tools { proc IBRCambpell {} { #source O:/mad_projects_2/ANSYS/Macros/IBR_CAS.tcl ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' } proc viewManager {} { ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ ViewManager.tcl' } proc powerAnnotation {} { ans_sendcommand ~eui,'source ...

How to compile tcl or encrypt tcl
I use TclPro1.5 to compile my tcl script with tixwish in the Solaris before. But I cannot use the same method in Linux. Why? Is there any utility for me to compile or encrypt the code by using tixwish? The following is the simple code if I use the tixwish: #!/home/albertl/local/bin/tixwish puts "haha" And after using procomp by the TclPro1.5 Error in startup script: The TclPro ByteCode Loader is not available or does not support the correct version while executing "error "The TclPro ByteCode Loader is not available or does not support the correct version"" invoked from within "if {[catch {package require tbcload 1.3} err] == 1} { error "The TclPro ByteCode Loader is not available or does not support the correct version" ...." (file "a.tbc" line 4) The problem seems that tbcload1.3 cannot be found? But tbcload is already there "/home/albertl/local/lib/tbcload1.3" Why? Can anyone tell me? stratus schrieb: > I use TclPro1.5 to compile my tcl script with tixwish in the Solaris before. > But I cannot use the same method in Linux. Why? > > Is there any utility for me to compile or encrypt the code by using tixwish? > Tixwish is just a wish shell with the Tix package baked in. If TclPro does not have a specific bigwish with Tix included your out of luck on that road (but could build your own if you liked). You might have success with freewrap or TDK, don't know for su...

tcl application with tcl application
Here is another question, I have one tcl-based application A, my co- worker has a tcl-based application B. Now I want to integrate my application A into the application B. After integration, I want to be able to run A's tcl command in B. Assume I can only change A's code, is there any way to do this? On 17 Dez., 07:03, teacupfull business <teacupfull.busin...@gmail.com> wrote: > Here is another question, I have one tcl-based application A, my co- > worker has a tcl-based application B. Now I want to integrate my > application A into the application B. >...

How Tcl speaks for itself and how Tcl is not spoken for...
Hello It's Friday and... well... Two things about Tcl going through my mind this week, a nice anecdote and a eyebrow-rising thing on Wikipedia: Anecdote: Until three months ago I worked in a scientific institue where I wrote much software in Tcl, especially a big Build and Report System, some tools for automatic checking of coding style and other things. Tcl had a bad reputation there (not because of me... they dropped Tcl before I started there in favour of Joy, then JavaScript and now Python) and besides me, there was only one co-worker who appearantly writes some small Tcl-Scripts to support other researchers in their work. To get completely rid of Tcl, they even started to reimplement all things, I wrote in Tcl in Python just to have it in a language, that most of them know (which is a good decision on the one hand, but on the other hand, I think, it would be better to simply learn Tcl ;-), which made me a little bit sad. Now there is a new collegue who has to maintain some of the things I wrote. Comming from Perl he wasn't exactly enthusiastic when he heard, that he must maintain my old code in such an obscure language.. Two weeks ago, I got mail from him. He's just studying a complex system of scripts that are used for a sandboxed build system for source code which comes from external untrusted source and must be compiled and tested. Of course it's written in Tcl (and some bash-Scripting). He told me, that although he has never looked at Tcl before,...

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature
Hi, TCL has a command execution syntax like this: [<tcl cmd>] Anything inside the 3rd bracket will be executed as a Tcl command by the Tcl interprater. Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? In other words, my Tcl interprator should print "[32]" for tcl command puts "[32]" It should not try to treat [] as a special character. Is this any way possible while extending Tcl in C with tcl.h? Thank you, Arijit * arijit79@gmail.com | puts "[32]" | | It should not try to treat [] as a special character. Check out the TCL quoting rules. http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M10 http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M15 Any of puts {[32]} puts "\[32\]" will do the trick. R' On May 8, 3:14 am, ariji...@gmail.com wrote: > Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? By doing this, you would disable the primary functionality of Tcl. I'm certain you could go into the tcl source and stop it - but why not talk about what you are really trying to do. Perhaps someone can give you a better way of doing what you are wanting to do. ...

Why can execution results in tcl shell differ than if using tcl script??
Hi, I have been posting a thread here: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/983d7ef3e4b1ab54# I have another question that might be related to it, I'm doing set of tcl commands (involving external shell commands execution) one time in tcl shell, and the other from a tcl script.. Although both command sequences are the same, I get quite different results!!! Why did this happens?? Thanks, Ahmad Ahmad wrote: > Hi, > > I have been posting a thread here: > http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/983d7ef3e4b1ab54# > > I have another question that might be related to it, I'm doing set of > tcl commands (involving external shell commands execution) one time in > tcl shell, and the other from a tcl script.. > > Although both command sequences are the same, I get quite different > results!!! Why did this happens?? > > Thanks, > Ahmad The interactive Tcl shell has access to external functionality that a running script doesn't. That's done to make the interactive environment easier to work with. What, specifically, is the command sequence you're issuing in both cases? Jeff Hi Jeff, Thank you for your reply. I've a tcl script that finally creates a certain script, that is when I run from shell using "calibredrv -gui <certainRunScript>" from command line it do exactly what I expect. I have tried two scenarios of trials, and only one of...

TCL C API: receiving command from a script or from tcl command line ?
Hello, TCL allows to run commands from commandl line or from within a script file thanks to the command "source filename". I used TCL C API to embed my own commands. My question is : from my own commands, how can I know whether it was called from the script or directly from the shell ? Thanks, Fabrice Hi Fabrice, "fabrice" writes: > I used TCL C API to embed my own commands. My question is : from my > own commands, how can I know whether it was called from the script > or directly from the shell ? You can look at the variable tcl_interactive to distinguish the two modes. Note: It usually seems not a good idea to change the behaviour of your functions between use in a program (production mode) and interactive use (usually for experimentation and debugging). It's confusing for the users and it may make it difficult or impossible to reproduce some kinds of problems interactively. If you want to add more debug output in interactive mode, you can always add additional commands and flags for that purpose. benny fabrice wrote: > Hello, > > TCL allows to run commands from commandl line or from within a script > file thanks to the command "source filename". > > I used TCL C API to embed my own commands. My question is : from my own > commands, how can I know whether it was called from the script or > directly from the shell ? You could look at how the 'tcl_interactive' variable is set up and u...

tcl hangs on exit for multiple open calls from within same tcl script
Hi, I am looking to run a couple of processes in parallel. But a strange hang = occurs randomly. I am invoking two tcl commands using open in parallel. Now= after a while one of the process would just hang indefinitely which I am n= ot able to understand why. The issue is easily reproducible on win 2008 ser= ver and other multi core machines. Am I doing something wrongly? What is th= e best way to do this? To reproduce, you just have to create the files and run loop.bat. You shoul= d see the hang within 15-20 minutes. Following are the files I am using=20 ******** loop.bat ****** @echo off :loop tclsh 1.tcl goto loop ***************** Contents of file 1.tcl ***************** #!/bin/sh #DO NOT CHANGE THOSE 3 FIRST LINES \ exec tclsh $0 "$@" set status [catch { exec tclsh 2.tcl } outcmd] puts $outcmd exit 0 ******* Contents of file 2.tcl ***** #!/bin/sh #DO NOT CHANGE THOSE 3 FIRST LINES \ exec tclsh $0 "$@" set cmd1 "tclsh 6.tcl &" set cmd2 "tclsh 5.tcl &" set out1 "" set out2 "" proc isProcessDone { channel logText } { gets $channel currentline while {[eof $channel] =3D=3D 0} { set logText "$logText\n $currentline" gets $channel currentline } return $logText } puts "hi" set imChannel1 [open "| $cmd1"] puts "hi1 $imChannel1" set imChannel2 [open "| $cmd2"] puts...

tcl-inotify: File & directory level notifications for Tcl. (extension)
This is an announcement for a relatively new Tcl project: tcl-inotify. Tcl-inotify is a Tcl interface to the linux kernel's inotify* service. It provides a Tcl package that enables Tcl scripts to monitor the file system changes at a file and directory level. A large number of file/directory actions can be monitored. A proc is executed asynchronously to notify for changes. * inotify is a Linux kernel subsystem that provides file system event notifications. It was written by John McCutchan with help from Robert Love and later Amy Griffis to replace dnotify. It was included in the mainline kernel starting from release 2.6.13, and could be compiled into 2.6.12 and possibly earlier releases by use of a patch. Its function is essentially an extension to filesystems to notice changes to the filesystem, and report those changes to applications. Home page: http://sourceforge.net/projects/tcl-inotify/ Man page: http://tcl-inotify.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Tcl
Hello, where can I see for tcl syntacs and how-to run a tcl test? Thank You Vittore ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: ptolemy-hackers-request@ptolemy.eecs.berkeley.edu ...

TCL
Hello, i would like to build TCL/TK as a separate DLL-Library. Can anyone tell me how this can be done with VC 6.0? Best regards, Reinhold "Reinhold.kwauka" <bernd-reinhold.kwauka@t-online.de> wrote: >Hello, > >i would like to build TCL/TK as a separate DLL-Library. Can anyone tell me >how this can be done >with VC 6.0? > >Best regards, >Reinhold > 1) get the source from http://tcl.sourceforge.net/ 2) open a command prompt 3) cd to the win/ subdirectory 4) call vcvars32.bat located in ??\vc98\bin\ of vc6 for wherever you installed it. 5) type @ the prompt: nmake -f makefile.vc -- David Gravereaux <davygrvy@pobox.com> [species: human; planet: earth,milkyway(western spiral arm),alpha sector] Reinhold.kwauka wrote: > Hello, > > i would like to build TCL/TK as a separate DLL-Library. Can anyone tell me > how this can be done > with VC 6.0? > > Best regards, > Reinhold > > Its already done. Just download a binary release for windows and check \Program Files\Tcl\lib for the DLLs and static libraries. ...

Tcl
Hello all. I found on hobbes the afaik latest Tcl for Os/2 v8.35 Is there any newer port, cause i try to update the eggdrop and that says: Your Tcl version is much too old for Eggdrop to use. You should download and compile a more recent version. The most reliable current version is 8.5.X and can be downloaded from ftp://tcl.activestate.com/pub/tcl/tcl8_5/. -- With the best regards from the Netherlands, Tu, "Tellerbop" <Tellerbop@wint.nl>, hai scritto questo in data Wed, 14 Jan 2009 19:11:18 UTC: > Hello all. > > I found on hobbes the afaik latest Tcl for Os/2...

How to open a pty from Tcl (or "please translate C example to Tcl")
Hello out there, still struggling with getting TCP/IP to work in my somewhat bizarre setup (TCP/IP over 10.000 Volt power-line modems) I got a hint to try to use a pseudo tty. I got the advice --- What you would do is write a small C program (or perl, or any of a number of other languages). This program would call the "openpty" function, which: - Locates the next available (unused) pseudo-TTY device in the system, - Opens both ends of it, into two different descriptors, - Returns the file-descriptor numbers for the two ends (the "slave" end which mimics a tty, and the master end that your program will be using as the intercept point), and the filename of the slave (e.g. "/dev/ptya0"). --- Q1: Any way I could accomplish this from Tcl? Well, knowing nothing about openpty and pseude ttys I hunted around and found the following code snippet: --- /* * Allocate pseudo tty, returns master side fd. * Stores slave name in the first arg(must be large enough). */ int pty_open(char *sl_name) { int mr_fd; char ptyname[] = "/dev/ptyXY"; char ch[] = "pqrstuvwxyz"; char digit[] = "0123456789abcdefghijklmnopqrstuv"; int l, m; /* This algorithm should work for almost all standard Unices */ for(l=0; ch[l]; l++ ) { for(m=0; digit[m]; m++ ) { ptyname[8] = ch[l]; ptyname[9] = digit[m]; /* Open the master */ if( (mr_fd=open(ptyname, O_RDWR)) < 0 ) continue...

TCL/PHP/XML problem: I need to convert an XML file into a TCL list
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: [TCL] set contents [read $fileID [file size ${fileName}.xml]]; close $fileID if {![string equal $switch -body]} { # ONLY DO THIS IF THE XML CONTENTS CONTAIN NO BODY - WILL UPGRADE AT A LATER DATE 11/24/2006 - PHIL global serverName if {![info exists serverName]} { global env source ./cgi_globals.tcl global serverName } if {[string length [info procs {URL_ENCODE}]] == 0} { source...

Web resources about - Dose there any tcl script to translate an file with embedded tcl - comp.lang.tcl

File:Google Translate.PNG - Wikipedia, the free encyclopedia
This image is a screenshot of a copyrighted web page , and the copyright for it is most likely held by owner of the website. It may also contain ...

Report: Success On The Field For MLB Teams Translates Into Success On Facebook
Success on the field translates into success in terms of adding Facebook likes for Major League Baseball teams, according to a new analysis from ...

CSS Hat translates Photoshop layer styles to CSS3
This will be a huge hit. ∞ Read this on The Loop

Facebook-connected fitness apps translate into real life success
Fitness applications are growing in popularity — largely because they work well, especially when a user connects the app to their Facebook account. ...

Twitter Blog: It takes a community to translate Twitter
Twitter Blog It takes a community to translate Twitter 5355886907516812597 Monday, August 01, 2011 Twitter celebrated its first non-English launch ...

Translate Text into spoken voice in a foreign language with myLanguage Translator Pro for iPhone, iPod ...
Get Translate Text into spoken voice in a foreign language with myLanguage Translator Pro on the App Store. See screenshots and ratings, and ...

translate suggest - Flickr - Photo Sharing!
Explore jensminor's photos on Flickr. jensminor has uploaded 1567 photos to Flickr.

10 languages Google Translate lacks and where to find them
Google Translate doesn’t have it all. Here is where you can find Cantonese, Pashto and Amharic, plus some other famous languages around the world ...

Microsoft Translator for iOS can now translate text within images
... just added support for image-based translation in Microsoft Translator for iOS. Get the picture Now, you can use Microsoft Translator to translate ...

Suuns releasing new album 'Hold/Still' share single "Translate" and remix, touring
by Bill Pearis Montreal's Suuns toured with Disappears last year and their performance at Rough Trade featured a lot of new material, much of ...

Resources last updated: 3/13/2016 5:31:31 PM