Re: spawn on IDL virtual machine [message #50570] |
Mon, 09 October 2006 16:11 |
Luke
Messages: 4 Registered: October 2006
|
Junior Member |
|
|
Something like...
if STRLOWCASE(!VERSION.OS_FAMILY) EQ 'windows' then $
spawn, 'DIR C:\TEMP' $
else $
spawn, 'ls /tmp'
|
|
|
Re: spawn on IDL virtual machine [message #50592 is a reply to message #50570] |
Mon, 09 October 2006 08:21  |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
Sverre,
In UNIX, both spawn and call_external work with no problems inside the
VM. To the best of my knowledge there has be no attempt to disable them
like the way execute is disabled so I'd imagine there is no real problem
using them on windows either.
However, it's unlikely that code originally written for UNIX will work
with windows where spawn is concerned. Chances are there were some
assumptions about paths etc. or, worse still, the IDL was spawning a
UNIX command like 'ls' or 'rm'.
Thanks,
Allan
Sverre Solberg wrote:
> Is there a way to run code that contains the "spawn" command by the IDL
> virtual machine? I presume not :-( but would like to ask anyway. This
> is a code originally made for Unix, so it crashes when running the VM
> (with spawn) on Windows, which is not so surprising. But perhaps there
> is a way to test for platform inside the program and modify the call to
> "spawn" accordingly??
>
> Sverre
>
|
|
|
Re: spawn on IDL virtual machine [message #50593 is a reply to message #50592] |
Mon, 09 October 2006 08:12  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Sverre Solberg writes:
> Is there a way to run code that contains the "spawn" command by the IDL
> virtual machine? I presume not :-( but would like to ask anyway. This
> is a code originally made for Unix, so it crashes when running the VM
> (with spawn) on Windows, which is not so surprising. But perhaps there
> is a way to test for platform inside the program and modify the call to
> "spawn" accordingly??
The various fields of the !VERSION system variable will
tell you almost everything you need to know about what
version of IDL you are running. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|