Menu

exec -> bad file number

Scripting
De Kus
2005-02-07
2013-01-06
  • De Kus

    De Kus - 2005-02-07

    I have trief a few things, after reading over exec again in the TCL doc I found the theoretically correct expression to call it. This is what I am currently using:

    if {[catch {exec bash.exe -c "whois $query"} input] } {

    I run ' bash.exe -c "whois t-online.de" ' from win xp command line and it executed the whois command corretly. The script seems not to have an other concerning error, since the captured error in $input will be forwarded via puthelp NOTICE $nick like:

    [06:28:38] <@StarZ|De_Kus> ?whois t-online.de
    [06:28:39] -StarZ|Clan- Fehler: couldn't duplicate input handle: bad file number

    I have searched here and on egghelp.org, but couldn't find any solution. Is there simply none, or am I just too stupid to find one?

    Addional Debug:
    .status //not complete output :)
    running eggdrop v1.7.0+gotmsg-CHANMETA
    OS: CYGWIN_NT-5.1 1.5.12(0.116/4/2)
    Tcl Bibliothek: C:/Programme/eggdrop/lib/tcl8.4
    Tcl version: 8.4.7 (header version 8.4.7)

    .set errorInfo
    Currently: couldn't duplicate input handle: bad file number
    Currently: while executing
    Currently: "exec cmd.exe /c whois $query"

    set errorCode
    Currently: POSIX EBADF {bad file number}

    .tcl exec c:/Programme/putty.exe
    Tcl error: couldn't duplicate input handle: bad file number
    .set errorCode
    Currently: POSIX EBADF {bad file number}

     
    • De Kus

      De Kus - 2005-04-10
       
    • kirben

      kirben - 2005-05-05

      Try the current version of 1.6.18 CVS.

       
      • De Kus

        De Kus - 2005-05-05

        I actually use that version...

         
    • kirben

      kirben - 2005-05-05

      Use Eggdrop v1.6.18+sigsetjmp from http://windrop.sourceforge.net/downloads.html which was just updated yesterday.

       
      • De Kus

        De Kus - 2005-05-08

        No, I'm not using the compilation here.
        I just recompiled with newest cygwin and a snapshot from just a few days ago, same result. But then I found that there is finally a TCL version 8.4.9 avaible in the compilation section. Recompiled the bot and voila, its working ^-^. So the trick is the new TCL version, not the new eggdrop version ;).

         
    • kirben

      kirben - 2005-05-13

      The problem was the way earlier Tcl builds were compiled, using a mix of Windows code.
      The current Tcl version was compiled as unix build, so performs much better overall.

       
    • googly moogly

      googly moogly - 2005-12-01

      Clue me in, please, but is it true that the way to get EXEC to work on windrop is to downgrade to ~1.6.12-15 or so? I seem to recall I fixed the exec problem by downgrading before, but I'd rather not do that since that screwed me over with that incessant opening/closing of ports bug...

      I've tried v1.6.17, v1.6.18 from May and the latest v1.6.18 at the time (Nov 28) without any luck whatsoever.

      .tcl exec "blabla" gets me this:

      Tcl error: couldn't create error file for command: no such file or directory

      Both in -nt, -n and default mode. On XP SP2.

      TCL 8.4.11 doesn't help at all for me (that's the included version anyhow, right?).

      Help, I'm getting desperate here :/ I seriously can't understand how it could be so difficult to fix... I mean, it used to work........ and many years have passed. What are the TCL dudes doing about it?

       
      • googly moogly

        googly moogly - 2005-12-01

        Actually, running just tcl 8.4.11 from the prompt and trying exec, it won't work. Same error message. So, will I have to find an older, working version of tcl? Or is cygwin the culprit? Trust me, I've read all the tcl-on-win32 discussions I could find through google and I couldn't find any decisive info whatsoever... a reference about /tmp/ or /var/tmp file permissions keeps coming up but it's not like that can be fixable on win32, now is it?

         
        • googly moogly

          googly moogly - 2005-12-01

          Nevermind. I actually solved it. I went backwards in versions of TCL until I came to 8.4.9, which seems to be the last one that actually works (I took the lib dir from the ActiveState compile). Sure, it didn't work at first, but I blindly managed to find out that if I took the ActiveState tcl84.dll and renamed it to libtcl8.4.dll and overwrote said file in the eggdrop root, it works.

          Now the question is why there's no info about this anywhere? Or why an obviously non-working TCL version is packaged with windrop... Oh well. It's fixed. I'm happy. Now I have to write this  down so I remember how to do it in the future.

           

Log in to post a comment.

MongoDB Logo MongoDB