From: Alexandre Ferrieux on
On Jul 29, 4:17 pm, jmc <jm.c...(a)orens.fr> wrote:
>
> From the command.com shell (WinXP): "convert logo.bmp logo.gif" works
> fine.
> But if I try from Tcl to do "exec convert logo.bmp logo.gif", Tcl
> returns an error message for the last argument I can't figure why.
> Here is what I did :
>
> Trentor) 5 % exec convert logo.bmp logo.gif
> ParamÅ tre non valide - logo.gif

The only way I can explain this, is having different PATH values
between the two shells. This may include the current directory if "."
is in the PATH (dunno if it's possible in Windows).

Try cd-ing to the same directory in both cmd.exe and tclsh.exe before
trying this.

-Alex
From: Donal K. Fellows on
On 29 July, 22:29, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com>
wrote:
> The only way I can explain this, is having different PATH values
> between the two shells. This may include the current directory if "."
> is in the PATH (dunno if it's possible in Windows).

The current directory is *always* searched for things to execute on
Windows. IIRC, it's searched before looking at the PATH.

Donal.
From: jmc on
On 30 juil, 10:27, "Donal K. Fellows"
<donal.k.fell...(a)manchester.ac.uk> wrote:
> On 29 July, 22:29, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com>
> wrote:
>
> > The only way I can explain this, is having different PATH values
> > between the two shells. This may include the current directory if "."
> > is in the PATH (dunno if it's possible in Windows).
>
> The current directory is *always* searched for things to execute on
> Windows. IIRC, it's searched before looking at the PATH.
>
> Donal.

Ok. I've found the cause of error message of "exec" command. It seems
to me that contrary of my undestanding of the doc, on WinXP the exec
command *doesn't* search the file to be executed in the PATH
environnement variable :
() 1 % pwd
C:/
() 2 % puts $env(PATH)
C:\Program Files\ImageMagick-6.6.3-Q16;C:\Program Files\Seagate
Software\NOTES\;C:\Program Files\Seagate Software\NOTES\DATA\;C:\TCL
\TclDevKit\bin;C:\Program Files\ActiveState Komodo IDE 5\;C:\TCL\bin;C:
\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files
\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave
Systems Corp\Gemalto\Access Client\v5\
() 3 % file exists logo.bmp
1
() 4 % exec convert logo.bmp logo.gif
ParamÅ tre non valide - logo.gif
() 5 %

The file convert.exe *is* in C:\Program Files\ImageMagick-6.6.3-Q16
directory.

Observation : IMHO, the error message produced by exec not finding the
file to execute is clearly wrong...

Jean-Marie


From: MSEdit on
On Jul 30, 1:51 pm, jmc <jm.c...(a)orens.fr> wrote:
> On 30 juil, 10:27, "Donal K. Fellows"
>
> <donal.k.fell...(a)manchester.ac.uk> wrote:
> > On 29 July, 22:29, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com>
> > wrote:
>
> > > The only way I can explain this, is having different PATH values
> > > between the two shells. This may include the current directory if "."
> > > is in the PATH (dunno if it's possible in Windows).
>
> > The current directory is *always* searched for things to execute on
> > Windows. IIRC, it's searched before looking at the PATH.
>
> > Donal.
>
> Ok. I've found the cause of error message of "exec" command. It seems
> to me that contrary of my undestanding of the doc, on WinXP the exec
> command *doesn't* search the file to be executed in the PATH
> environnement variable :
> () 1 % pwd
> C:/
> () 2 % puts $env(PATH)
> C:\Program Files\ImageMagick-6.6.3-Q16;C:\Program Files\Seagate
> Software\NOTES\;C:\Program Files\Seagate Software\NOTES\DATA\;C:\TCL
> \TclDevKit\bin;C:\Program Files\ActiveState Komodo IDE 5\;C:\TCL\bin;C:
> \WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files
> \NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave
> Systems Corp\Gemalto\Access Client\v5\
> () 3 % file exists logo.bmp
> 1
> () 4 % exec convert logo.bmp logo.gif
> ParamÅ tre non valide - logo.gif
> () 5 %
>
> The file convert.exe *is* in C:\Program Files\ImageMagick-6.6.3-Q16
> directory.
>
> Observation : IMHO, the error message produced by exec not finding the
> file to execute is clearly wrong...
>
> Jean-Marie

It looks like the message is comming from your convert program NOT
from exec. It has nothing to do with the PATH, you could try
explicitly exec'ing convert.exe as any stray convert.com/convert.bat
could cause trouble.

Martyn
From: jmc on
On 30 juil, 14:36, MSEdit <mse...(a)gmail.com> wrote:
> On Jul 30, 1:51 pm, jmc <jm.c...(a)orens.fr> wrote:
>
>
>
> > On 30 juil, 10:27, "Donal K. Fellows"
>
> > <donal.k.fell...(a)manchester.ac.uk> wrote:
> > > On 29 July, 22:29, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com>
> > > wrote:
>
> > > > The only way I can explain this, is having different PATH values
> > > > between the two shells. This may include the current directory if ".."
> > > > is in the PATH (dunno if it's possible in Windows).
>
> > > The current directory is *always* searched for things to execute on
> > > Windows. IIRC, it's searched before looking at the PATH.
>
> > > Donal.
>
> > Ok. I've found the cause of error message of "exec" command. It seems
> > to me that contrary of my undestanding of the doc, on WinXP the exec
> > command *doesn't* search the file to be executed in the PATH
> > environnement variable :
> > () 1 % pwd
> > C:/
> > () 2 % puts $env(PATH)
> > C:\Program Files\ImageMagick-6.6.3-Q16;C:\Program Files\Seagate
> > Software\NOTES\;C:\Program Files\Seagate Software\NOTES\DATA\;C:\TCL
> > \TclDevKit\bin;C:\Program Files\ActiveState Komodo IDE 5\;C:\TCL\bin;C:
> > \WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files
> > \NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave
> > Systems Corp\Gemalto\Access Client\v5\
> > () 3 % file exists logo.bmp
> > 1
> > () 4 % exec convert logo.bmp logo.gif
> > ParamÅ tre non valide - logo.gif
> > () 5 %
>
> > The file convert.exe *is* in C:\Program Files\ImageMagick-6.6.3-Q16
> > directory.
>
> > Observation : IMHO, the error message produced by exec not finding the
> > file to execute is clearly wrong...
>
> > Jean-Marie
>
> It looks like the message is comming from your convert program NOT
> from exec. It has nothing to do with the PATH, you could try
> explicitly exec'ing convert.exe as any stray convert.com/convert.bat
> could cause trouble.
>
> Martyn

Hi Martyn,

I'm not sure if Tcl can forward error message from a subprocess being
executed at the OS level. If it does, that's nice.

But, in my preceding post, convert.exe was not executed at all.

I've just uninstalled my old ImageMagick suite.
Prior to re-install a newer relase of ImageMagick, here is what I
did :

() 1 % pwd
C:/
() 2 % file exists logo.bmp
1
() 3 % exec convert logo.bmp logo.gif
ParamÅ tre non valide - logo.gif
() 4 %

Here the file convert.exe doesn't exist any more on my HD...

Jean-Marie