ActiveTcl discussion

Tcl and ActiveTcl usage questions; Tcl practices and programming questions

Multi process handling in TCl script

Need solution for parallel processing in tcl (windows).

I tried with thread, still not able to achieve desired output.

To simplify My requirement I am giving a simple example as following. Requirement: I want to run notepad.exe without effecting my current execution of flow. From main thread control should go to called thread, start notepad.exe and come back to main thread with out closing the notepad .

Tried:(Tcl script)

package require Thread

set a 10

proc test_thread {b} {

puts "in procedure $b"
set tid [thread::create] ;# Create a thread
return $tid
}

TCL code debugging from Visual Studio 2015

Hi:
I would like to know if there are any tools which can help facilitate debugging of TCL source code from Visual Studio 2015.
Thanks,
RP

snmptools issue

When executing:
> snmp session lo -v1 -t0.1 -c public 192.168.1.254
> set ret [lo get sysDescr.0]
> lo close
Get Output:
SNMPv2-MIB::sysDescr.0 = STRING: SG300-10PP 10-Port Gigabit PoE+ Managed Switch

I can repeat this as many I want it is always correct. Read next why i am stating this

When I source:
proc Go {} {
snmp session lo -v1 -t0.1 -c public 192.168.1.254
set ret [lo get sysDescr.0]
lo close
return $ret
}

and execute:
> Go
SNMPv2-MIB::sysDescr.0 = STRING: SG300-10PP 10-Port Gigabit PoE+ Managed Switch

So far all is fine (you think...)

Running tclsh86 under cygwin doesn't show prompt

I have ActiveTcl 8.6 installed on my Windows7 PC. I also have latest cygwin installed.

I open the cygwin terminal, and execute tclsh86 with:

$ /cygdrive/c/Tcl/bin/tclsh86

No prompt is shown, but it appears the tclsh86 is running as expected: I can execute tcl scripts, and the output from the scripts is displayed.

I need to get the prompt to display (my eventual aim is to run tclsh86 using pexpect from python under cygwin; for this to work the expect() function needs to be able to see the prompt...)

Readline support

Has anyone looked into getting readline support for the interactive shell on windows? I know activestate can't put it on teapot because its GNU software, but I'm curious if anyone has figured out how to do it on their own. The rkeane teapot repo doesn't have it for windows either, but does have readline for other platforms, which is a little ominous.

Help: How to check for unmount/bad disks before read file

I need help here.
I have list of directory/file path and my program will read through every one.
Somehow one of the directory is unmount and cause my program hang over there when I'm try to open the file using command below.

catch {set directory_fid [open $filePath r]}

So, how can I check the directory status before I'm reading/open the file? I want to skip that file if no response for certain time and continue to read next file.

*[file isdir $dir] is not working as well
*There is no response when i'm using "ls -dir" in Unix also.

How to open files from TCL script with the same programs as done from Windows Explorer ?

Hello everyone,

I have a list of files of different types in a script (docx, jpg, pdf, etc) and want to invoke them by double-clicking on them, just as I do from windows explorer - with the same programs as it is done there(e.g., .docs with MS-Word, pdf with Adobe Acrobat Reader, etc).

My question - how can I pass the information from Windows to my TCL script with which program to open each file type?

Thanks,

tcltest::configure -singleproc issue

Hi,
I use tcltest package to start my automation test and when I specify tcltest::configure in all.tcl as below:
::tcltest::configure -verbose {body skip error pass start}
::tcltest::configure -testdir [file dirname [file normalize [info script]]]/testcase/YKT6000-5G
::tcltest::configure -file china_mobile_test_6.2.1.2_EVP_line.yk
::tcltest::configure -singleproc false
::tcltest::configure -outfile output.txt
::tcltest::configure -errfile error.txt
::tcltest::runAllTests

Question re opening files from TCL script with the same programs as done from Windows Explorer

Hello everyone,

I have a list of files of different types in a script (docx, jpg, pdf, etc) and want to invoke them by double-clicking on them, just as I do from windows explorer - with the same programs as it is done there(e.g., .docs with MS-Word, pdf with Adobe Acrobat Reader, etc).

My question - how can I pass the information from Windows to my TCL script with which program to open each file type?

Thanks,

Registering TCL as a Wscript scripting engine

I have ActiveTcl (8.6.4.1.299124 x_86_64) installed on a Windows 2012 server. When attempting to run a Tcl script via cscript, I get the following message:

C:\Tcl\bin>cscript //E:TclScript test.tcl
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Cscript error: Can't find script engine "TclScript" for script "C:\Tcl\bin\testltcl".

Do I have to manually register Tcl as a Wscript engine? If so, how?