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

Home » Public Forums » archive » Re: spawn question
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
Re: spawn question [message #60590] Mon, 02 June 2008 06:48
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<9836d583-0a44-4bc1-b076-2b953089735a@26g2000hsk.googlegroups.com>,
russ <rlayberry@hotmail.com> wrote:

> i think i will just ask if the file has been created and if it hasnt
> after sometime, kill the GET command and do another one with a
> different http site
>
> russ

I suggest that you look into curl and wget. I successfully SPAWN curl processes
to put and get files from remote http and ftp servers.

This curl command puts a file to an ftp server in the background using my .netrc
file for authentication (via anonymous ftp)

SPAWN, 'curl -n -s -T local_file.png ftp://host.domain/directory/remote_file.png &'

There is also the IDLnetURL object, but we have had problems with it crashing
the IDL session. This has been reported to ITTVIS, but no solution yet (that
I know of).

Ken Bowman
Re: spawn question [message #60600 is a reply to message #60590] Sun, 01 June 2008 15:41 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jun 1, 2:25 pm, russ <rlaybe...@hotmail.com> wrote:
> On 1 Jun, 19:33, Vince Hradil <hrad...@yahoo.com> wrote:
>
>> On Jun 1, 1:09 pm, russ <rlaybe...@hotmail.com> wrote:
>
>>> On 31 May, 17:21, Vince Hradil <hrad...@yahoo.com> wrote:
>
>>>> On May 31, 5:20 am, russ <rlaybe...@hotmail.com> wrote:
>
>>>> > this may be a tupid question and it might be that i am an idiot,
>>>> > but...
>
>>>> > i want to spawn a process
>
>>>> > cmd='ls -l'
>>>> > spawn,cmd
>
>>>> > i am actually doing this with a GET command and it sometimes hangs
>
>>>> > if i try
>
>>>> > spawn,cmd,/nowait
>
>>>> > it tells me
>
>>>> > Keyword NOWAIT not allowed in call to: SPAWN
>
>>>> > but it says it is in the help?
>
>>>> > any ideas?
>
>>>> > thanks
>
>>>> > russ
>
>>>> Your using the GET command?  So what exactly are you spawning?- Hide quoted text -
>
>>>> - Show quoted text -
>
>>> I'm spawning
>
>>> cmd='GEThttp://www.etc> outfile.txt'
>>> spawn,cmd
>
>>> to get a webpage into a filer which then i can read
>
>> Now I'm confused - and I'm no expert on this, but don't you have to
>> have some kind of http connection to run a "GET" command?  The OS
>> won't know what to do with "GET" (unless you have some program called
>> GET that opens a connection and executes a GET).- Hide quoted text -
>
> sorry if i'm not being clear.  the GET command gets the contents of a
> website and the > operator puts it in a file which i subsequently
> read.
>
> sometimes the GET command hangs.  there is a timeout option on GET
> which I can't make work.
>
> i think i will just ask if the file has been created and if it hasnt
> after sometime, kill the GET command and do another one with a
> different http site
>
> russ

Yes, but GET is not an OS command. You need to have a stream from
which to GET the data? Maybe I'm wrong, like I said, I don't really
understand the whole thing. But if I type "GET http://www.yahoo.com"
at the command prompt, my OS says - "unknown command: GET" or
something like that.
Re: spawn question [message #60602 is a reply to message #60600] Sun, 01 June 2008 12:25 Go to previous message
russ[1] is currently offline  russ[1]
Messages: 8
Registered: April 2008
Junior Member
On 1 Jun, 19:33, Vince Hradil <hrad...@yahoo.com> wrote:
> On Jun 1, 1:09 pm, russ <rlaybe...@hotmail.com> wrote:
>
>
>
>
>
>> On 31 May, 17:21, Vince Hradil <hrad...@yahoo.com> wrote:
>
>>> On May 31, 5:20 am, russ <rlaybe...@hotmail.com> wrote:
>
>>>> this may be a tupid question and it might be that i am an idiot,
>>>> but...
>
>>>> i want to spawn a process
>
>>>> cmd='ls -l'
>>>> spawn,cmd
>
>>>> i am actually doing this with a GET command and it sometimes hangs
>
>>>> if i try
>
>>>> spawn,cmd,/nowait
>
>>>> it tells me
>
>>>> Keyword NOWAIT not allowed in call to: SPAWN
>
>>>> but it says it is in the help?
>
>>>> any ideas?
>
>>>> thanks
>
>>>> russ
>
>>> Your using the GET command?  So what exactly are you spawning?- Hide quoted text -
>
>>> - Show quoted text -
>
>> I'm spawning
>
>> cmd='GEThttp://www.etc> outfile.txt'
>> spawn,cmd
>
>> to get a webpage into a filer which then i can read
>
> Now I'm confused - and I'm no expert on this, but don't you have to
> have some kind of http connection to run a "GET" command?  The OS
> won't know what to do with "GET" (unless you have some program called
> GET that opens a connection and executes a GET).- Hide quoted text -
>

sorry if i'm not being clear. the GET command gets the contents of a
website and the > operator puts it in a file which i subsequently
read.

sometimes the GET command hangs. there is a timeout option on GET
which I can't make work.

i think i will just ask if the file has been created and if it hasnt
after sometime, kill the GET command and do another one with a
different http site

russ
Re: spawn question [message #60603 is a reply to message #60602] Sun, 01 June 2008 11:33 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jun 1, 1:09 pm, russ <rlaybe...@hotmail.com> wrote:
> On 31 May, 17:21, Vince Hradil <hrad...@yahoo.com> wrote:
>
>> On May 31, 5:20 am, russ <rlaybe...@hotmail.com> wrote:
>
>>> this may be a tupid question and it might be that i am an idiot,
>>> but...
>
>>> i want to spawn a process
>
>>> cmd='ls -l'
>>> spawn,cmd
>
>>> i am actually doing this with a GET command and it sometimes hangs
>
>>> if i try
>
>>> spawn,cmd,/nowait
>
>>> it tells me
>
>>> Keyword NOWAIT not allowed in call to: SPAWN
>
>>> but it says it is in the help?
>
>>> any ideas?
>
>>> thanks
>
>>> russ
>
>> Your using the GET command?  So what exactly are you spawning?- Hide quoted text -
>
>> - Show quoted text -
>
> I'm spawning
>
> cmd='GEThttp://www.etc> outfile.txt'
> spawn,cmd
>
> to get a webpage into a filer which then i can read

Now I'm confused - and I'm no expert on this, but don't you have to
have some kind of http connection to run a "GET" command? The OS
won't know what to do with "GET" (unless you have some program called
GET that opens a connection and executes a GET).
Re: spawn question [message #60604 is a reply to message #60603] Sun, 01 June 2008 11:09 Go to previous message
russ[1] is currently offline  russ[1]
Messages: 8
Registered: April 2008
Junior Member
On 31 May, 17:21, Vince Hradil <hrad...@yahoo.com> wrote:
> On May 31, 5:20 am, russ <rlaybe...@hotmail.com> wrote:
>
>
>
>
>
>> this may be a tupid question and it might be that i am an idiot,
>> but...
>
>> i want to spawn a process
>
>> cmd='ls -l'
>> spawn,cmd
>
>> i am actually doing this with a GET command and it sometimes hangs
>
>> if i try
>
>> spawn,cmd,/nowait
>
>> it tells me
>
>> Keyword NOWAIT not allowed in call to: SPAWN
>
>> but it says it is in the help?
>
>> any ideas?
>
>> thanks
>
>> russ
>
> Your using the GET command?  So what exactly are you spawning?- Hide quoted text -
>
> - Show quoted text -

I'm spawning

cmd='GET http://www.etc > outfile.txt'
spawn,cmd

to get a webpage into a filer which then i can read
Re: spawn question [message #60609 is a reply to message #60604] Sat, 31 May 2008 09:21 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On May 31, 5:20 am, russ <rlaybe...@hotmail.com> wrote:
> this may be a tupid question and it might be that i am an idiot,
> but...
>
> i want to spawn a process
>
> cmd='ls -l'
> spawn,cmd
>
> i am actually doing this with a GET command and it sometimes hangs
>
> if i try
>
> spawn,cmd,/nowait
>
> it tells me
>
> Keyword NOWAIT not allowed in call to: SPAWN
>
> but it says it is in the help?
>
> any ideas?
>
> thanks
>
> russ

Your using the GET command? So what exactly are you spawning?
Re: spawn question [message #60610 is a reply to message #60609] Sat, 31 May 2008 04:59 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<33a84552-1576-4ca3-a670-3f37064bf63c@59g2000hsb.googlegroups.com>,
russ <rlayberry@hotmail.com> wrote:

> this may be a tupid question and it might be that i am an idiot,
> but...
>
> i want to spawn a process
>
> cmd='ls -l'
> spawn,cmd
>
> i am actually doing this with a GET command and it sometimes hangs
>
> if i try
>
> spawn,cmd,/nowait
>
> it tells me
>
> Keyword NOWAIT not allowed in call to: SPAWN
>
> but it says it is in the help?

/NOWAIT only works on Windows. Are you running on Unix/Linux/Mac OS?

Use the standard Unix syntax to run a procedure in the background

SPAWN, 'ls -l &', result

Of course, then you get this


IDL> spawn, 'ls -l &', result
IDL> help, result
RESULT STRING = Array[1]
IDL> print, result
[1] 4624


If you want to actually see the output of ls, you will have to run
it in the foreground

IDL> spawn, 'ls -l', result
IDL> help, result
RESULT STRING = Array[41]


Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Project sav file in 7.0
Next Topic: Block selection in IDL7

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

Current Time: Wed Oct 08 18:40:16 PDT 2025

Total time taken to generate the page: 0.00709 seconds