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

Home » Public Forums » archive » IDL_IDLBridge, spawn, and sftp, oh my!
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
IDL_IDLBridge, spawn, and sftp, oh my! [message #87478] Wed, 05 February 2014 20:46 Go to next message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Hi all,

I am trying use IDL_IDLBridge to run a batch file containing spawn command that uses sftp to retrieve a file. If there is a more direct way, I would love to know. I'm on MacOSX and the sftp server is linux. and I'm using ssh public keys so i don't have to enter the password every time.

The issue is that while the file is sftp'ing, I'd like to do other things...
so an idl_idlBridge object->Execute with a /nowait seems like a good idea. Here is the code:


;;;;;;;;;;;begin code
file='myfile' ;<-generated on the fly actually
oBridge = OBJ_NEW('IDL_IDLBridge')
cmd2 = "scp server.internet.com:"+file+" ."
openw,lun, 'dummy.pro', /get_lun
printf,lun,'spawn, "'+cmd2+'"'
close, lun
obridge->execute, "@dummy.pro", /nowait


COMMAND1
COMMAND2
COMMAND3

while oBridge->status() ne 0 do wait, 0.1 ;check that oBridge is done every .1s

;now that oBridge (and the three COMMAND lines) are done, proceed...
;;;;;;;;;;;end code

so the file dummy.pro is created and contains:

spawn, "scp server.internet.com:file ."


I can run it with @ at the IDL> prompt, but the IDL_IDLBridge won't run it.

any ideas on how to make this work? or even better on how to do this better?

Many thanks,
G
Re: IDL_IDLBridge, spawn, and sftp, oh my! [message #87479 is a reply to message #87478] Wed, 05 February 2014 23:27 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Thursday, February 6, 2014 5:46:05 AM UTC+1, Gianguido Cianci wrote:
> Hi all,
>
>
>
> I am trying use IDL_IDLBridge to run a batch file containing spawn command that uses sftp to retrieve a file. If there is a more direct way, I would love to know. I'm on MacOSX and the sftp server is linux. and I'm using ssh public keys so i don't have to enter the password every time.
>
>
>
> The issue is that while the file is sftp'ing, I'd like to do other things...
>
> so an idl_idlBridge object->Execute with a /nowait seems like a good idea. Here is the code:
>
>
>
>
>
> ;;;;;;;;;;;begin code
>
> file='myfile' ;<-generated on the fly actually
>
> oBridge = OBJ_NEW('IDL_IDLBridge')
>
> cmd2 = "scp server.internet.com:"+file+" ."
>
> openw,lun, 'dummy.pro', /get_lun
>
> printf,lun,'spawn, "'+cmd2+'"'
>
> close, lun
>
> obridge->execute, "@dummy.pro", /nowait
>
>
>
>
>
> COMMAND1
>
> COMMAND2
>
> COMMAND3
>
>
>
> while oBridge->status() ne 0 do wait, 0.1 ;check that oBridge is done every .1s
>
>
>
> ;now that oBridge (and the three COMMAND lines) are done, proceed...
>
> ;;;;;;;;;;;end code
>
>
>
> so the file dummy.pro is created and contains:
>
>
>
> spawn, "scp server.internet.com:file ."
>
>
>
>
>
> I can run it with @ at the IDL> prompt, but the IDL_IDLBridge won't run it.
>
>
>
> any ideas on how to make this work? or even better on how to do this better?
>
>
>
> Many thanks,
>
> G

Hi Guido,
just a guess: it might be that idl_idlbridge is looking for @dummy.pro in the wrong directory. Try to check that (maybe with pwd).

Regards,
Helder
Re: IDL_IDLBridge, spawn, and sftp, oh my! [message #87480 is a reply to message #87479] Wed, 05 February 2014 23:49 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Thursday, February 6, 2014 8:27:58 AM UTC+1, Helder wrote:
> On Thursday, February 6, 2014 5:46:05 AM UTC+1, Gianguido Cianci wrote:
>
>> Hi all,
>
>>
>
>>
>
>>
>
>> I am trying use IDL_IDLBridge to run a batch file containing spawn command that uses sftp to retrieve a file. If there is a more direct way, I would love to know. I'm on MacOSX and the sftp server is linux. and I'm using ssh public keys so i don't have to enter the password every time.
>
>>
>
>>
>
>>
>
>> The issue is that while the file is sftp'ing, I'd like to do other things...
>
>>
>
>> so an idl_idlBridge object->Execute with a /nowait seems like a good idea. Here is the code:
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> ;;;;;;;;;;;begin code
>
>>
>
>> file='myfile' ;<-generated on the fly actually
>
>>
>
>> oBridge = OBJ_NEW('IDL_IDLBridge')
>
>>
>
>> cmd2 = "scp server.internet.com:"+file+" ."
>
>>
>
>> openw,lun, 'dummy.pro', /get_lun
>
>>
>
>> printf,lun,'spawn, "'+cmd2+'"'
>
>>
>
>> close, lun
>
>>
>
>> obridge->execute, "@dummy.pro", /nowait
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> COMMAND1
>
>>
>
>> COMMAND2
>
>>
>
>> COMMAND3
>
>>
>
>>
>
>>
>
>> while oBridge->status() ne 0 do wait, 0.1 ;check that oBridge is done every .1s
>
>>
>
>>
>
>>
>
>> ;now that oBridge (and the three COMMAND lines) are done, proceed...
>
>>
>
>> ;;;;;;;;;;;end code
>
>>
>
>>
>
>>
>
>> so the file dummy.pro is created and contains:
>
>>
>
>>
>
>>
>
>> spawn, "scp server.internet.com:file ."
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> I can run it with @ at the IDL> prompt, but the IDL_IDLBridge won't run it.
>
>>
>
>>
>
>>
>
>> any ideas on how to make this work? or even better on how to do this better?
>
>>
>
>>
>
>>
>
>> Many thanks,
>
>>
>
>> G
>
>
>
> Hi Guido,
>
> just a guess: it might be that idl_idlbridge is looking for @dummy.pro in the wrong directory. Try to check that (maybe with pwd).
>
>
>
> Regards,
>
> Helder

Hi Guido,
to debug, try running something like this:
oBridge = OBJ_NEW('IDL_IDLBridge', output='E:\OutputLocation\out.txt')
obridge->execute, "pwd"
obj_destroy, obridge

Then have a look at the file.

I then created a file named LaunchPwd.pro with a single line in it, containing pwd.
By running the file from the "wrong" location:
oBridge = OBJ_NEW('IDL_IDLBridge', output='E:\OutputLocation\out.txt')
obridge->execute, "@LaunchPwd"
obj_destroy, obridge

I get this:
% Error opening file. File: LaunchPwd

But with:
oBridge = OBJ_NEW('IDL_IDLBridge', output='E:\OutputLocation\out.txt')
obridge->execute, "cd, 'OutputLocation\'"
obridge->execute, "@LaunchPwd"
obj_destroy, obridge

I get:
% Compiled module: PWD.
E:\Elmitec\IDL\MySoftware\DynTP

So I would only guess that you have a path related problem. But that is just a guess. In general the keyword Output is your friend in finding out what happend.

Ciao,
Helder
Re: IDL_IDLBridge, spawn, and sftp, oh my! [message #87491 is a reply to message #87480] Fri, 07 February 2014 12:52 Go to previous message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Thanks Helder, I'll have a look!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: subseting a 3D array based on values from a 2D array
Next Topic: Keywords and properties (in function graphics)

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

Current Time: Wed Oct 08 11:44:47 PDT 2025

Total time taken to generate the page: 0.00470 seconds