tcl

TCL development: debug environment

I like a bit of TiVo hacking in spare time - TiVo uses a Linux variant and TCL. I'd like to write TCL scripts on my Windows laptop, test them and then FTP them over to my TiVo. Can I have a recommendation for a TCL debugging environment for Windows, please? ...

How do I display an image with ltk?

I have written code to read a windows bitmap and would now like to display it with ltk. How can I construct an appropriate object? Is there such functionality in ltk? If not how can I do it directly interfacing to tk? ...

Why won't Tcl die?

I've been forced to code in Tcl a number of times, and just can't wrap my head around this language. It's not just that it is syntactically different than c-like languages: Lisp is different but genius, prolog is different with a valid cause. Tcl is different because it was a bad idea taken to its fullest possible extension. "Lets mak...

Timeout doesn't work with '-re' flag in expect script

I'm trying to get an expect script to work, and when I use the -re flag (to invoke regular expression parsing), the 'timeout' keyword seems to no longer work. When the following script is run, I get the message 'timed out at step 1', then 'starting step 2' and then it times out but does NOT print the 'timed out at step 2' I just get a ne...

Tcl/Tk examples?

Tcl/Tk is a simple way to script small GUIs. Can anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget. If you have other nice and clean examples for useful tasks, please add them too. ...

Does TCL have some concept of function pointers?

Working with TCL and I'd like to implement something like the Strategy Pattern. I want to pass in the "strategy" for printing output in a TCL function, so I can easily switch between printing to the screen and printing to a log file. What's the best way to do this in TCL? ...

No drop packets using the error models for wirelesss scenario ?

I am trying to use the error model in ns2 with wireless links, I am using ns2.33. I tried the uniform error model and the markov chain model. No errors from ns but when I am trying to find the dropped packets due to corruption I can not find any of them using either the uniform or markov models. So please help me if I made any error in ...

How can I monitor a flow over wireless connection ?

I am trying to monitor a tcp flow using flow monitor. attach-fmon wants link object which is not available in wireless connections, how can I solve this problem ? are there any other solutions ? My code is here http://pastebin.com/f59241692 I got this error message eid@eid-laptop:~/code/ns2/noisy$ ns mixed.tcl num_nodes is set 3 INITI...

TCL: Two way communication between threads in Windows

I need to have two way communication between threads in Tcl and all I can get is one way with parameters passing in as my only master->helper communication channel. Here is what I have: proc ExecProgram { command } { if { [catch {open "| $command" RDWR} fd ] } { # # Failed, return error indication # ...

How do I get Ltk to display what the user is writing and what the functions print?

The kind of functions are of the sort of: (defun display-all () "Display all items in the database." (dolist (item database) (format t "~{~a:~10t~a~%~}~%" item))) (defun prompt-read (prompt) (format query-io "~a: " prompt) (force-output query-io) (read-line query-io)) (defun prompt-for-item () (make-database (prompt...

What's better for DSL: TCL or Lisp?

What's better for DSL: TCL or Lisp? What can you say about Java(C#)-TCL binding versus Lisp(Scheme)? What DSL tool is applicable for .Net development? (excepting Microsoft DSL tools) ...

LDAP Authentication using CGI+TCL

How can I authenticate a user with LDAP using CGI/TCL stack? Please provide a sample code-snippet if possible. I am using an Apache Web Server on RHEL 5.0; AD exists on a remote Win2003 server. ...

How do I retrofit a GUI to an existing C program?

I've been working on a project of porting an old solaris CL program to run on Linux, and barring some unrelated hardware issues, that's finished. Now I want a GUI for it, so the user can choose among the various options with drop downs and check boxes, as well as some text input areas for options that aren't so restricted, like the filen...

What's stored in that Tcl variable?

Pursuant to the advice given in this question I have written a little gui to take the options for a command line C program and pass them on to said C program which is already set up to process them. It displays just like I wanted. However, I would like to verify that the values stored in the variables are correct. Getting the values to...

Why is topdir set to its default value when rpmbuild called from tcl ?

Hi, I have a tcl script which 'exec' rpmbuild. When doing so, the 'topdir' used by rpmbuild is wrong. I have a .rpmmacros file in my home directory and if I call manually rpmbuild, it works fine, ie. the 'topdir' is not the default one. I added a [exec rpmbuild "--showrc" ] in the tcl script to check the value of topdir and it says '-...

TCL: Recursively search subdirectories to source all .tcl files

Hi. I have a main TCL proc that sources tons of other tcl procs in other folders and subsequent subdirectories. For example, in the main proc it has: source $basepath/folderA/1A.tcl source $basepath/folderA/2A.tcl source $basepath/folderA/3A.tcl source $basepath/folderB/1B.tcl source $basepath/folderB/2B.tcl source $basepath/folderB/3...

Why is modulus different in different programming languages?

Perl print 2 % -18; --> -16 Tcl puts [expr {2 % -18}] --> -16 but VBScript wscript.echo 2 mod -18 --> 2 Why the difference? ...

Getting Expect to interact until the program terminates

I am using the linux too Expect and I have to interact with the shell. However, it's not a true interact, I just want to see what's going on. How can I get Expect to exit after the interacting program exits? ...

What is the difference between spawn and exec?

I'm learning to write a TCL (expect) scripts and I notice that some examples show to use spawn, while others show the command exec. I tried googling, but can't find what is the difference? Suppose I call 'exec' in a middle of a long expect script, what can I expect to happen? ...

How to rename/move all files with a certain extension?

I'm learning tcl (expect) and now I came to an interesting issue. I need a command to move/rename a bunch of files with extension .status. I tried these: spawn /bin/mv *.status some_dir exec /bin/mv *.status some_dir Of course, that did not work. I googled a bit and found something about glob, but it doesn't seem to work the way I wan...