Found a script I wanted to try, and it errors. Narrowed it down to the
exec command.
Tried some experimenting, and didn't figure it out yet.
Always get this: couldn't create error file for command: no such file or directory
Even tried in partyline: .tcl exec dir
and get:
<botnick> [14:19] tcl: evaluate (.tcl): exec dir
<botnick> Tcl error: couldn't create error file for command: no such file or directory
I'm pretty sure I've used exec on a linux eggdrop, and it worked ok.
But this is a Windrop I'm working on this time.
There must be something simple I've missing....
(I see it mentioned, with a search here, but I didn't find a definitive answer to the problem. )
Well, the error is simple enough. On windows system, there is no binary named dir (that's an internal command in the "dos prompt"/"command prompt" - aka command.com or cmd.exe). As such, you'll have to launch the command promt and pass on the "dir" command to it.
So, simple enough, the exec command can only launch binaries with either full path, or located within the search path. It will not load any external command parsers such as command.com automatically.
The very same applies under linux-systems; I.E you cannot use the Bash internal command "jobs" directly from the exec command, but you need to load a bash shell first...
nml375 wrote:Well, the error is simple enough. On windows system, there is no binary named dir (that's an internal command in the "dos prompt"/"command prompt" - aka command.com or cmd.exe). As such, you'll have to launch the command promt and pass on the "dir" command to it.
So, simple enough, the exec command can only launch binaries with either full path, or located within the search path. It will not load any external command parsers such as command.com automatically.
Ahh...
I hadn't considered that.
Thanks.
The very same applies under linux-systems; I.E you cannot use the Bash internal command "jobs" directly from the exec command, but you need to load a bash shell first...
That sounds like what I did. ... a bash script. First line would have loaded the shell.
It's been a while... I'd have to go check to be sure though.
Sorry, overlooked the "couldn't create error file" part :/
The error is thrown by the TclCreatePipeline function, which is responsible for building the needed pipes (if any) and tracking the pid's of all generated subprocesses.
Since the exec command supports pipes, tcl has to establish the means of the pipes. This is partly done using TclpCreateTempFile() (creates an opened, deleted file). In the windows-ported version it should create this file in the system temporary directory, or wherever your TMP or TEMP environment variable points at. If this function fails to return a valid TclFile resource, the above mentioned error is thrown.
You could try adding "2>@1" to the end of the command line, as this will redirect any output to stdErr to stdOut, removing the need for a separate error file alltogether.