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

Home » Public Forums » archive » Re: SPAWN and strings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: SPAWN and strings [message #73373 is a reply to message #73372] Fri, 05 November 2010 07:46 Go to previous messageGo to previous message
KRDean is currently offline  KRDean
Messages: 69
Registered: July 2006
Member
On Nov 5, 4:49 am, Ludo <lu...@orange.fr> wrote:
> I'm running IDL 7.1 on Windows XP SP2
> I tried this in the command line (cmd.exe) :
>
>> "C:\Program Files\myDir\myProg.exe" "C:\directory name with spaces\myFile.h5"
>
> It works.
>
> When I try the same command with SPAWN, it doesn't work. (I put spaces
> around ' and " for an easy reading, in my command there aren't any
> spaces.)
>
> SPAWN, ' "C:\Program Files\myDir\myProg.exe" "C:\directory name with
> spaces\myFile.h5" '
>
> It tries to lauch C:\Program, just like there weren't any quotes
> ( " ). I have the impression that SPAWN can't handle more than two "
> in a string. Why ?
>
> As expected, if my working directory is "C:\directory name with
> spaces", the following instruction works perfectly :
>
> SPAWN, ' "C:\Program Files\myDir\myProg.exe" myFile.h5'
>
> This one fails :
>
> SPAWN, ' "C:\Program Files\myDir\myProg.exe" "myFile.h5" '
>
> Did I miss something ? Some trick in strings management ?

Actually, it is an Environment Variable trick. I found this tip in
ITTVIS Tech tip. However, I forgot the Tip #.
Anyway, it works for me getting into the Windows XP UserProfile (C:
\Documents and Settings\kdean)

env = 'CMDUSERPROFILE=' + '"' + GETENV('USERPROFILE') + '\"'
SETENV, env
cmd = '%cmduserprofile%apps\PuTTY\Plink -ssh -v -batch ' +
runtime_machine + ' -l ' + username + ' ls -la'
SPAWN, CMD, listing, EXIT_STATUS = errOut, /STDERR, /LOG_OUTPUT

Kelly Dean
Milliken, CO
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to average every nth data?
Next Topic: Re: MultiDrizzle and IDL

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

Current Time: Sun Oct 12 06:44:52 PDT 2025

Total time taken to generate the page: 0.32173 seconds