comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Help with SPAWN
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Help with SPAWN [message #42260] Fri, 21 January 2005 17:27 Go to next message
Marc Reinig is currently offline  Marc Reinig
Messages: 30
Registered: June 2004
Member
I am running a Windows exe file from IDL. The EXE takes a single string
parameter.

tmp_path = '"' + exe_path + ' ' + result_path + '"'
spawn, tmp_path

It brings up the command window, runs the program, and works fine. Life is
good!

Now I want to run it without the command window showing. However,

spawn, tmp_path /NOSHELL won't run.

What am I missing?

Thanks in advance,

-Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics
Re: Help with Spawn [message #61482 is a reply to message #42260] Fri, 18 July 2008 07:17 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 18, 8:48 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
> On Jul 18, 7:23 am, alex...@gmail.com wrote:
>
>> Hello everybody. My question is simple, yet I haven't found a
>> satisfying answer in the various guides.
>
>> I'm using spawn to call for an executable file under the Windows OS,
>> it oppens a command window and executes there. The problem is, very
>> quickly I get an error and the entire command shell closes
>> momentarily. I'd want  to be able to see the error it presents before
>> closing the shell, or just leave it open.
>
>> Is this possible? Is there any other way around it?
>
>> Thanks a lot for any help, Alex
>
> Another trick i do a lot is just print out the command that you're
> going to spawn using a print statement, then open up your own command
> window and paste in that command.  The command shell isn't going to
> close when you do that, and I often find it's easier to fix whatever
> mistakes i've made with the command i'm trying to issue in the actual
> command window then go back to my IDL program and make sure it spawns
> the fixed command.
>
> Jeff

How about using the LOG_OUTPUT keyword? Simple is good...
Re: Help with Spawn [message #61485 is a reply to message #42260] Fri, 18 July 2008 06:48 Go to previous messageGo to next message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Jul 18, 7:23 am, alex...@gmail.com wrote:
> Hello everybody. My question is simple, yet I haven't found a
> satisfying answer in the various guides.
>
> I'm using spawn to call for an executable file under the Windows OS,
> it oppens a command window and executes there. The problem is, very
> quickly I get an error and the entire command shell closes
> momentarily. I'd want  to be able to see the error it presents before
> closing the shell, or just leave it open.
>
> Is this possible? Is there any other way around it?
>
> Thanks a lot for any help, Alex

Another trick i do a lot is just print out the command that you're
going to spawn using a print statement, then open up your own command
window and paste in that command. The command shell isn't going to
close when you do that, and I often find it's easier to fix whatever
mistakes i've made with the command i'm trying to issue in the actual
command window then go back to my IDL program and make sure it spawns
the fixed command.

Jeff
Re: Help with Spawn [message #61487 is a reply to message #42260] Fri, 18 July 2008 06:06 Go to previous messageGo to next message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
On Jul 18, 8:23 pm, alex...@gmail.com wrote:
> Hello everybody. My question is simple, yet I haven't found a
> satisfying answer in the various guides.
>
> I'm using spawn to call for an executable file under the Windows OS,
> it oppens a command window and executes there. The problem is, very
> quickly I get an error and the entire command shell closes
> momentarily. I'd want to be able to see the error it presents before
> closing the shell, or just leave it open.
>
> Is this possible? Is there any other way around it?
>
> Thanks a lot for any help, Alex

Why not use the "result" argument, and do a print,result to see what
errors or output text was generated?


SPAWN [, Command [, Result] [, ErrResult] ]
Re: Help with Spawn [message #61542 is a reply to message #42260] Sat, 19 July 2008 12:53 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Jul 19, 9:22 am, Vince Hradil <hrad...@yahoo.com> wrote:
> On Jul 18, 7:37 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>
>
>> On Jul 18, 1:46 pm, Vince Hradil <hrad...@yahoo.com> wrote:
>
>>> On Jul 18, 12:24 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>>>> On Jul 18, 10:17 am, Vince Hradil <hrad...@yahoo.com> wrote:
>
>>>> > On Jul 18, 8:48 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>>>> > > On Jul 18, 7:23 am, alex...@gmail.com wrote:
>
>>>> > > > Hello everybody. My question is simple, yet I haven't found a
>>>> > > > satisfying answer in the various guides.
>
>>>> > > > I'm using spawn to call for an executable file under the Windows OS,
>>>> > > > it oppens a command window and executes there. The problem is, very
>>>> > > > quickly I get an error and the entire command shell closes
>>>> > > > momentarily. I'd want  to be able to see the error it presents before
>>>> > > > closing the shell, or just leave it open.
>
>>>> > > > Is this possible? Is there any other way around it?
>
>>>> > > > Thanks a lot for any help, Alex
>
>>>> > > Another trick i do a lot is just print out the command that you're
>>>> > > going to spawn using a print statement, then open up your own command
>>>> > > window and paste in that command.  The command shell isn't going to
>>>> > > close when you do that, and I often find it's easier to fix whatever
>>>> > > mistakes i've made with the command i'm trying to issue in the actual
>>>> > > command window then go back to my IDL program and make sure it spawns
>>>> > > the fixed command.
>
>>>> > > Jeff
>
>>>> > How about using the LOG_OUTPUT keyword?  Simple is good...
>
>>>> I've actually had that keyword not work for me a few times.  It's
>>>> always been when the program i've tried to spawn was not an OS command
>>>> (e.g., dir, cd, etc.), and i think it was also a program where the
>>>> output wasn't outputting one line of text for each iteration but
>>>> rather doing a sequence like print output/clear screen/print output/
>>>> etc....
>
>>>> This was a long time ago and a minor issue so i just did the cut-and-
>>>> paste-the-spawn-string trick i mentioned earlier and then moved on :)
>>>> It would be good to know, though, if this is something anyone else has
>>>> run into...
>
>>> It works for me:
>
>>> IDL> cd, 'c:\temp'
>>> IDL> spawn, 'dir', /log_output
>>>  Volume in drive C has no label.
>>>  Volume Serial Number is 8C6A-7ADD
>
>>>  Directory of c:\temp
>
>>> 07/01/2008  11:23 AM    <DIR>          .
>>> 07/01/2008  11:23 AM    <DIR>          ..
>>>                0 File(s)              0 bytes
>>>                2 Dir(s)  12,076,867,584 bytes free
>>> IDL> print, !version
>>> { x86 Win32 Windows Microsoft Windows 7.0 Oct 25 2007      32      64}
>
>> Right, spawning a 'dir' command works for me too, as does any of the
>> other "internal" commands.  I just tried the command line version of
>> my sFTP program however, which is not part of what used to be DOS, and
>> the keyword does not work.  I'm guessing it has to do with the way
>> text is written to stout somehow?? Anyway this is on IDL 6.2 and WinXP
>> SP3.
>
> Oh, I see - I misread your earlier comment.  I thought you said it
> fails when it IS an internal command.
>
> Here's a little test I did with 7zip.
>
> IDL> cd, 'c:\temp'
> IDL> spawn, 'dir', /log_output
>  Volume in drive C has no label.
>  Volume Serial Number is 8C6A-7ADD
>
>  Directory of c:\temp
>
> 07/19/2008  08:18 AM    <DIR>          .
> 07/19/2008  08:18 AM    <DIR>          ..
> 07/19/2008  08:18 AM                 0 test.txt
>                1 File(s)              0 bytes
>                2 Dir(s)  12,129,624,064 bytes free
> IDL> spawn, 'c:\program files\7-Zip\7z.exe ', /log_output
> 'c:\program' is not recognized as an internal or external command,
> operable program or batch file.
> IDL> spawn, '"c:\program files\7-Zip\7z.exe"', /log_output
>
> 7-Zip  4.58 beta  Copyright (c) 1999-2008 Igor Pavlov  2008-05-05
>
> Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
>        [<@listfiles...>]
>
> <Commands>
>   a: Add files to archive
>   b: Benchmark
>   d: Delete files from archive
>   e: Extract files from archive (without using directory names)
>   l: List contents of archive
>   t: Test integrity of archive
>   u: Update files to archive
>   x: eXtract files with full paths
> <Switches>
>   -ai[r[-|0]]{@listfile|!wildcard}: Include archives
>   -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
>   -bd: Disable percentage indicator
>   -i[r[-|0]]{@listfile|!wildcard}: Include filenames
>   -m{Parameters}: set compression Method
>   -o{Directory}: set Output directory
>   -p{Password}: set Password
>   -r[-|0]: Recurse subdirectories
>   -scs{UTF-8 | WIN | DOS}: set charset for list files
>   -sfx[{name}]: Create SFX archive
>   -si[{name}]: read data from stdin
>   -slt: show technical information for l (List) command
>   -so: write data to stdout
>   -ssc[-]: set sensitive case mode
>   -ssw: compress shared files
>   -t{Type}: Set type of archive
>   -v{Size}[b|k|m|g]: Create volumes
>   -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
>   -w[{path}]: assign Work directory. Empty path means a temporary
> directory
>   -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
>   -y: assume Yes on all queries
> IDL> spawn, '"c:\program files\7-Zip\7z.exe" test.txt', /log_output
>
> 7-Zip  4.58 beta  Copyright (c) 1999-2008 Igor Pavlov  2008-05-05
>
> Error:
> Incorrect command line
> IDL> spawn, '"c:\program files\7-Zip\7z.exe" a -tgzip test.txt.gz
> test.txt', /log_output
>
> 7-Zip  4.58 beta  Copyright (c) 1999-2008 Igor Pavlov  2008-05-05
> Scanning
>
> Creating archive test.txt.gz
>
> Compressing  test.txt
>
> Everything is Ok
> IDL> spawn, 'dir', /log_output
>  Volume in drive C has no label.
>  Volume Serial Number is 8C6A-7ADD
>
>  Directory of c:\temp
>
> 07/19/2008  08:20 AM    <DIR>          .
> 07/19/2008  08:20 AM    <DIR>          ..
> 07/19/2008  08:18 AM                 0 test.txt
> 07/19/2008  08:20 AM                32 test.txt.gz
>                2 File(s)             32 bytes
>                2 Dir(s)  12,129,591,296 bytes free

I actually thought about using my zip program as a test too, but
unfortunately even if you run it from the command line it still opens
up a window to report its progress in. That's the only other command
line program i have anymore :( wow times have changed. Anyway, the
program itself works fine when i spawn it from IDL. IDL just doesn't
capture the output when you set log_output. I think your results
confirm my earlier suspicion: that it's the program being spawned,
not IDL (or Windows), that is causing something to happen that makes
IDL unable to capture its output.
Re: Help with Spawn [message #61544 is a reply to message #61482] Sat, 19 July 2008 09:41 Go to previous message
alexbaz is currently offline  alexbaz
Messages: 4
Registered: April 2008
Junior Member
Thanks a lot, LOG_OUTPUT works like a charm.. (blonde moment by me)

Cheers
Re: Help with Spawn [message #61546 is a reply to message #42260] Sat, 19 July 2008 06:22 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 18, 7:37 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
> On Jul 18, 1:46 pm, Vince Hradil <hrad...@yahoo.com> wrote:
>
>
>
>> On Jul 18, 12:24 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>>> On Jul 18, 10:17 am, Vince Hradil <hrad...@yahoo.com> wrote:
>
>>>> On Jul 18, 8:48 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>>>> > On Jul 18, 7:23 am, alex...@gmail.com wrote:
>
>>>> > > Hello everybody. My question is simple, yet I haven't found a
>>>> > > satisfying answer in the various guides.
>
>>>> > > I'm using spawn to call for an executable file under the Windows OS,
>>>> > > it oppens a command window and executes there. The problem is, very
>>>> > > quickly I get an error and the entire command shell closes
>>>> > > momentarily. I'd want  to be able to see the error it presents before
>>>> > > closing the shell, or just leave it open.
>
>>>> > > Is this possible? Is there any other way around it?
>
>>>> > > Thanks a lot for any help, Alex
>
>>>> > Another trick i do a lot is just print out the command that you're
>>>> > going to spawn using a print statement, then open up your own command
>>>> > window and paste in that command.  The command shell isn't going to
>>>> > close when you do that, and I often find it's easier to fix whatever
>>>> > mistakes i've made with the command i'm trying to issue in the actual
>>>> > command window then go back to my IDL program and make sure it spawns
>>>> > the fixed command.
>
>>>> > Jeff
>
>>>> How about using the LOG_OUTPUT keyword?  Simple is good...
>
>>> I've actually had that keyword not work for me a few times.  It's
>>> always been when the program i've tried to spawn was not an OS command
>>> (e.g., dir, cd, etc.), and i think it was also a program where the
>>> output wasn't outputting one line of text for each iteration but
>>> rather doing a sequence like print output/clear screen/print output/
>>> etc....
>
>>> This was a long time ago and a minor issue so i just did the cut-and-
>>> paste-the-spawn-string trick i mentioned earlier and then moved on :)
>>> It would be good to know, though, if this is something anyone else has
>>> run into...
>
>> It works for me:
>
>> IDL> cd, 'c:\temp'
>> IDL> spawn, 'dir', /log_output
>>  Volume in drive C has no label.
>>  Volume Serial Number is 8C6A-7ADD
>
>>  Directory of c:\temp
>
>> 07/01/2008  11:23 AM    <DIR>          .
>> 07/01/2008  11:23 AM    <DIR>          ..
>>                0 File(s)              0 bytes
>>                2 Dir(s)  12,076,867,584 bytes free
>> IDL> print, !version
>> { x86 Win32 Windows Microsoft Windows 7.0 Oct 25 2007      32      64}
>
> Right, spawning a 'dir' command works for me too, as does any of the
> other "internal" commands.  I just tried the command line version of
> my sFTP program however, which is not part of what used to be DOS, and
> the keyword does not work.  I'm guessing it has to do with the way
> text is written to stout somehow?? Anyway this is on IDL 6.2 and WinXP
> SP3.

Oh, I see - I misread your earlier comment. I thought you said it
fails when it IS an internal command.

Here's a little test I did with 7zip.

IDL> cd, 'c:\temp'
IDL> spawn, 'dir', /log_output
Volume in drive C has no label.
Volume Serial Number is 8C6A-7ADD

Directory of c:\temp

07/19/2008 08:18 AM <DIR> .
07/19/2008 08:18 AM <DIR> ..
07/19/2008 08:18 AM 0 test.txt
1 File(s) 0 bytes
2 Dir(s) 12,129,624,064 bytes free
IDL> spawn, 'c:\program files\7-Zip\7z.exe ', /log_output
'c:\program' is not recognized as an internal or external command,
operable program or batch file.
IDL> spawn, '"c:\program files\7-Zip\7z.exe"', /log_output

7-Zip 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
[<@listfiles...>]

<Commands>
a: Add files to archive
b: Benchmark
d: Delete files from archive
e: Extract files from archive (without using directory names)
l: List contents of archive
t: Test integrity of archive
u: Update files to archive
x: eXtract files with full paths
<Switches>
-ai[r[-|0]]{@listfile|!wildcard}: Include archives
-ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
-bd: Disable percentage indicator
-i[r[-|0]]{@listfile|!wildcard}: Include filenames
-m{Parameters}: set compression Method
-o{Directory}: set Output directory
-p{Password}: set Password
-r[-|0]: Recurse subdirectories
-scs{UTF-8 | WIN | DOS}: set charset for list files
-sfx[{name}]: Create SFX archive
-si[{name}]: read data from stdin
-slt: show technical information for l (List) command
-so: write data to stdout
-ssc[-]: set sensitive case mode
-ssw: compress shared files
-t{Type}: Set type of archive
-v{Size}[b|k|m|g]: Create volumes
-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
-w[{path}]: assign Work directory. Empty path means a temporary
directory
-x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
-y: assume Yes on all queries
IDL> spawn, '"c:\program files\7-Zip\7z.exe" test.txt', /log_output

7-Zip 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05


Error:
Incorrect command line
IDL> spawn, '"c:\program files\7-Zip\7z.exe" a -tgzip test.txt.gz
test.txt', /log_output

7-Zip 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05
Scanning

Creating archive test.txt.gz

Compressing test.txt

Everything is Ok
IDL> spawn, 'dir', /log_output
Volume in drive C has no label.
Volume Serial Number is 8C6A-7ADD

Directory of c:\temp

07/19/2008 08:20 AM <DIR> .
07/19/2008 08:20 AM <DIR> ..
07/19/2008 08:18 AM 0 test.txt
07/19/2008 08:20 AM 32 test.txt.gz
2 File(s) 32 bytes
2 Dir(s) 12,129,591,296 bytes free
Re: Help with Spawn [message #61558 is a reply to message #42260] Fri, 18 July 2008 17:37 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Jul 18, 1:46 pm, Vince Hradil <hrad...@yahoo.com> wrote:
> On Jul 18, 12:24 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>
>
>> On Jul 18, 10:17 am, Vince Hradil <hrad...@yahoo.com> wrote:
>
>>> On Jul 18, 8:48 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>>>> On Jul 18, 7:23 am, alex...@gmail.com wrote:
>
>>>> > Hello everybody. My question is simple, yet I haven't found a
>>>> > satisfying answer in the various guides.
>
>>>> > I'm using spawn to call for an executable file under the Windows OS,
>>>> > it oppens a command window and executes there. The problem is, very
>>>> > quickly I get an error and the entire command shell closes
>>>> > momentarily. I'd want  to be able to see the error it presents before
>>>> > closing the shell, or just leave it open.
>
>>>> > Is this possible? Is there any other way around it?
>
>>>> > Thanks a lot for any help, Alex
>
>>>> Another trick i do a lot is just print out the command that you're
>>>> going to spawn using a print statement, then open up your own command
>>>> window and paste in that command.  The command shell isn't going to
>>>> close when you do that, and I often find it's easier to fix whatever
>>>> mistakes i've made with the command i'm trying to issue in the actual
>>>> command window then go back to my IDL program and make sure it spawns
>>>> the fixed command.
>
>>>> Jeff
>
>>> How about using the LOG_OUTPUT keyword?  Simple is good...
>
>> I've actually had that keyword not work for me a few times.  It's
>> always been when the program i've tried to spawn was not an OS command
>> (e.g., dir, cd, etc.), and i think it was also a program where the
>> output wasn't outputting one line of text for each iteration but
>> rather doing a sequence like print output/clear screen/print output/
>> etc....
>
>> This was a long time ago and a minor issue so i just did the cut-and-
>> paste-the-spawn-string trick i mentioned earlier and then moved on :)
>> It would be good to know, though, if this is something anyone else has
>> run into...
>
> It works for me:
>
> IDL> cd, 'c:\temp'
> IDL> spawn, 'dir', /log_output
>  Volume in drive C has no label.
>  Volume Serial Number is 8C6A-7ADD
>
>  Directory of c:\temp
>
> 07/01/2008  11:23 AM    <DIR>          .
> 07/01/2008  11:23 AM    <DIR>          ..
>                0 File(s)              0 bytes
>                2 Dir(s)  12,076,867,584 bytes free
> IDL> print, !version
> { x86 Win32 Windows Microsoft Windows 7.0 Oct 25 2007      32      64}

Right, spawning a 'dir' command works for me too, as does any of the
other "internal" commands. I just tried the command line version of
my sFTP program however, which is not part of what used to be DOS, and
the keyword does not work. I'm guessing it has to do with the way
text is written to stout somehow?? Anyway this is on IDL 6.2 and WinXP
SP3.
Re: Help with Spawn [message #61567 is a reply to message #42260] Fri, 18 July 2008 10:46 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 18, 12:24 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
> On Jul 18, 10:17 am, Vince Hradil <hrad...@yahoo.com> wrote:
>
>
>
>> On Jul 18, 8:48 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>>> On Jul 18, 7:23 am, alex...@gmail.com wrote:
>
>>>> Hello everybody. My question is simple, yet I haven't found a
>>>> satisfying answer in the various guides.
>
>>>> I'm using spawn to call for an executable file under the Windows OS,
>>>> it oppens a command window and executes there. The problem is, very
>>>> quickly I get an error and the entire command shell closes
>>>> momentarily. I'd want  to be able to see the error it presents before
>>>> closing the shell, or just leave it open.
>
>>>> Is this possible? Is there any other way around it?
>
>>>> Thanks a lot for any help, Alex
>
>>> Another trick i do a lot is just print out the command that you're
>>> going to spawn using a print statement, then open up your own command
>>> window and paste in that command.  The command shell isn't going to
>>> close when you do that, and I often find it's easier to fix whatever
>>> mistakes i've made with the command i'm trying to issue in the actual
>>> command window then go back to my IDL program and make sure it spawns
>>> the fixed command.
>
>>> Jeff
>
>> How about using the LOG_OUTPUT keyword?  Simple is good...
>
> I've actually had that keyword not work for me a few times.  It's
> always been when the program i've tried to spawn was not an OS command
> (e.g., dir, cd, etc.), and i think it was also a program where the
> output wasn't outputting one line of text for each iteration but
> rather doing a sequence like print output/clear screen/print output/
> etc....
>
> This was a long time ago and a minor issue so i just did the cut-and-
> paste-the-spawn-string trick i mentioned earlier and then moved on :)
> It would be good to know, though, if this is something anyone else has
> run into...

It works for me:

IDL> cd, 'c:\temp'
IDL> spawn, 'dir', /log_output
Volume in drive C has no label.
Volume Serial Number is 8C6A-7ADD

Directory of c:\temp

07/01/2008 11:23 AM <DIR> .
07/01/2008 11:23 AM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 12,076,867,584 bytes free
IDL> print, !version
{ x86 Win32 Windows Microsoft Windows 7.0 Oct 25 2007 32 64}
Re: Help with Spawn [message #61569 is a reply to message #61482] Fri, 18 July 2008 10:24 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Jul 18, 10:17 am, Vince Hradil <hrad...@yahoo.com> wrote:
> On Jul 18, 8:48 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>
>
>> On Jul 18, 7:23 am, alex...@gmail.com wrote:
>
>>> Hello everybody. My question is simple, yet I haven't found a
>>> satisfying answer in the various guides.
>
>>> I'm using spawn to call for an executable file under the Windows OS,
>>> it oppens a command window and executes there. The problem is, very
>>> quickly I get an error and the entire command shell closes
>>> momentarily. I'd want  to be able to see the error it presents before
>>> closing the shell, or just leave it open.
>
>>> Is this possible? Is there any other way around it?
>
>>> Thanks a lot for any help, Alex
>
>> Another trick i do a lot is just print out the command that you're
>> going to spawn using a print statement, then open up your own command
>> window and paste in that command.  The command shell isn't going to
>> close when you do that, and I often find it's easier to fix whatever
>> mistakes i've made with the command i'm trying to issue in the actual
>> command window then go back to my IDL program and make sure it spawns
>> the fixed command.
>
>> Jeff
>
> How about using the LOG_OUTPUT keyword?  Simple is good...

I've actually had that keyword not work for me a few times. It's
always been when the program i've tried to spawn was not an OS command
(e.g., dir, cd, etc.), and i think it was also a program where the
output wasn't outputting one line of text for each iteration but
rather doing a sequence like print output/clear screen/print output/
etc....

This was a long time ago and a minor issue so i just did the cut-and-
paste-the-spawn-string trick i mentioned earlier and then moved on :)
It would be good to know, though, if this is something anyone else has
run into...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: plot,lat,lon
Next Topic: Re: plot,lat,lon

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:01:11 PDT 2025

Total time taken to generate the page: 0.00703 seconds