From: jmc on
On 30 juil, 15:31, jmc <jm.c...(a)orens.fr> wrote:
> 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

Correction : just tried the above command at the OS level; the error
message comes from the OS (and is forwarded by Tcl) -> no blame for
Tcl :-).

Jean-Marie
From: jmc on
On 30 juil, 15:46, jmc <jm.c...(a)orens.fr> wrote:
> On 30 juil, 15:31, jmc <jm.c...(a)orens.fr> wrote:
>
>
>
> > 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
>
> Correction : just tried the above command at the OS level; the error
> message comes from the OS (and is forwarded by Tcl) -> no blame for
> Tcl :-).
>
> Jean-Marie

Diving more deeply ...

Investigating further, it appears that WinXP provides *allso* an
convert.exe program (for converting FAT files -> NTFS), colliding with
the convert.exe from ImageMagick...

I had made the assuption that the search order for an executable was
the same between Tcl and WinXP. I'm not sure any more of this as an
different search order is the sole explanation I can find why doing
"convert logo.bmp logo.gif" from the command.com shell executes
ImageMagick's program and why doing the same from the Tcl shell (with
"exec") execute WinXP's utility...

Jean-Marie





From: Alexandre Ferrieux on
On Jul 30, 5:19 pm, jmc <jm.c...(a)orens.fr> wrote:
> On 30 juil, 15:46, jmc <jm.c...(a)orens.fr> wrote:
>
>
>
>
>
> > On 30 juil, 15:31, jmc <jm.c...(a)orens.fr> wrote:
>
> > > 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
>
> > Correction : just tried the above command at the OS level; the error
> > message comes from the OS (and is forwarded by Tcl) -> no blame for
> > Tcl :-).
>
> > Jean-Marie
>
> Diving more deeply ...
>
> Investigating further, it appears that WinXP provides *allso* an
> convert.exe program (for converting FAT files -> NTFS), colliding with
> the convert.exe from ImageMagick...
>
> I had made the assuption that the search order for an executable was
> the same between Tcl and WinXP. I'm not sure any more of this as an
> different search order is the sole explanation I can find why doing
> "convert logo.bmp logo.gif" from the command.com shell executes
> ImageMagick's program and why doing the same from the Tcl shell (with
> "exec") execute WinXP's utility...

You don't read replies to your questions, do you ?
Several people have already hinted at that name collision you've just
rediscovered.
Untangling the knot involves finding out the current directory and
current value of PATH in both cases.
Please do that now and report instead of continuing speculations.

-Alex