tcl exec unable to open file

Posted by rlegault33@yahoo.ca on 2011-11-02 09:49
Forums: ActiveTcl support | OS: Windows 7

It appears that the exec cannot call a path specified binary or file.
WHY?
What must I specify in my env

% info tclversion
8.5
% info patchlevel
8.5.10
% which snmpget
/usr/local/bin/snmpget
% exec /usr/local/bin/snmpget
couldn't execute "\usr\local\bin\snmpget": no such file or directory
% exec snmpget
MIB search path: /cygdrive/c/tq_development/.snmp/mibs;/usr/local/share/snmp/mibs
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)

When snmpget is run from cygwin it is fine

$ snmpget -Dparse-mibs
registered debug token parse-mibs, 1
parse-mibs: Scanning directory /cygdrive/c/tq_development/.snmp/mibs
parse-mibs: cannot open MIB directory /cygdrive/c/tq_development/.snmp/mibs
parse-mibs: Scanning directory /usr/local/share/snmp/mibs
parse-mibs: Checking file: /usr/local/share/snmp/mibs/AGENTX-MIB.txt...
parse-mibs: Module 0 AGENTX-MIB is in /usr/local/share/snmp/mibs/AGENTX-MIB.tx

% parray env
env(ALLUSERSPROFILE) = C:\ProgramData
env(AMDAPPSDKROOT) = C:\Program Files\AMD APP\
env(APPDATA) = C:\Users\rlegault.TAQUA\AppData\Roaming
env(CLASSPATH) = .;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
env(COMMONPROGRAMFILES) = C:\Program Files\Common Files
env(COMPUTERNAME) = ##########
env(COMSPEC) = C:\Windows\system32\cmd.exe
env(FPPUILang) = en-US
env(FP_NO_HOST_CHECK) = NO
env(HOME) = C:\tq_development
env(HOMEDRIVE) = C:
env(HOMEPATH) = #############
env(HOSTNAME) = #########
env(INFOPATH) = /usr/local/info:/usr/share/info:/usr/info:
env(LANG) = C.UTF-8
env(LOCALAPPDATA) = C:\Users\#######\AppData\Local
env(LOGONSERVER) = \\TNT0DC001
env(MANPATH) = /usr/local/man:/usr/share/man:/usr/man::/usr/ssl/
man
env(MYNAME) = ########
env(NUMBER_OF_PROCESSORS) = 2
env(OLDPWD) = /cygdrive/c/tq_development
env(OOBEUILang) = en-US
env(OPENSSL_CONF) = C:\OpenSSL-Win32\bin\openssl.cfg
env(OS) = Windows_NT
env(OnlineServices) = Online Services
env(PATH) = C:\cygwin\usr\local\bin;C:\cygwin\bin;C:\Perl\sit
e\bin;C:\Perl\bin;C:\Program Files\AMD APP\bin\x86;C:\Program Files\Common Files
\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System3
2\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\TortoiseSVN\b
in;C:\program files\gnuarm\bin;C:\Program Files\ATI Technologies\ATI.ACE\Core-St
atic;C:\Program Files\QuickTime\QTSystem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\PROGRA~1\Tcl
\bin;C:\PROGRA~1\MICROS~1.0\VC\bin;C:\Development\Tcl\bin;C:\Perl\site\bin;C:\Pe
rl\bin;C:\Program Files\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft
Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\W
indows\System32\WindowsPowerShell\v1.0;C:\Program Files\TortoiseSVN\bin;C:\progr
am files\gnuarm\bin;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Pro
gram Files\QuickTime\QTSystem;C:\Program Files\Microsoft SQL Server\100\Tools\Bi
nn;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\PROGRA~1\Tcl\bin;C:\PRO
GRA~1\MICROS~1.0\VC\bin
env(PATHEXT) = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;
.MSC
env(PRINTER) = Canon MF4360-4390_Toronto
env(PROCESSOR_ARCHITECTURE) = x86
env(PROCESSOR_IDENTIFIER) = x86 Family 6 Model 23 Stepping 10, GenuineIntel
env(PROCESSOR_LEVEL) = 6
env(PROCESSOR_REVISION) = 170a
env(PROGRAMFILES) = C:\Program Files
env(PS1) = \[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$
env(PSModulePath) = C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
env(PUBLIC) = C:\Users\Public
env(PWD) = /cygdrive/c/tq_development
env(Platform) = BPC
env(ProgramData) = C:\ProgramData
env(QTJAVA) = C:\Program Files\Java\jre6\lib\ext\QTJava.zip
env(SESSIONNAME) = Console
env(SHELL) = /bin/bash
env(SHLVL) = 1
env(SYSTEMDRIVE) = C:
env(SYSTEMROOT) = C:\Windows
env(TCLLIBPATH) = C:/Development/Tcl_testcases/utils C:/Development
/Tcl/Scotty/lib/tnm3.0.0 C:/Development/Tcl/Scotty/lib/tkined1.5.0 C:/Developmen
t/Tcl/tcl-snmptools-1.0
env(TEMP) = C:\cygwin\tmp
env(TERM) = cygwin
env(TMP) = C:\cygwin\tmp
env(USER) = rlegault
env(USERDNSDOMAIN) = TAQUA.LOCAL
env(USERDOMAIN) = TAQUA
env(USERNAME) = ########
env(USERPROFILE) = C:\Users\rlegault.TAQUA
env(VS100COMNTOOLS) = C:\Program Files\Microsoft Visual Studio 10.0\Com
mon7\Tools\
env(VSINSTALLDIR) = C:\PROGRA~1\MICROS~1.0\
env(WINDIR) = C:\Windows
env(_) = /cygdrive/c/Development/Tcl/bin/tclsh.exe
env(asl.log) = Destination=file
env(lib) = C:\Program Files\Microsoft.Net\Odbc.Net\
env(windows_tracing_flags) = 3
env(windows_tracing_logfile) = C:\BVTBin\Tests\installpackage\csilogfile.log
%

jeffh
ActiveState Staff
Fri, 2011-11-18 10:52

You are mixing cygwin and regular Windows in a way that isn't working for a proper Windows built Tcl. You should try the cygwin Tcl instead.

stephenm | Wed, 2011-11-23 09:22

none