Re: Path pitfalls....
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 26, 2002
- 434 views
Why are you forced to do this in a Windows environment? Can't you do it in DOS? You could write the Eu program as a DOS program and wrap it in a .BAT file. I suppose I'm not sure about how the whole thing gets kicked off. On Tue, 26 Nov 2002 11:01:29 +1100, <Patrick.Barnes at transgrid.com.au> wrote: > > No dice, it IS the "> bin\\export1.html" that's the problem. > > Also, does the program halt until the shellExecute is finished? If it > doesn't, then that is going to cause problems too. > > Qs: > --- > > 1. How to redirect stdout in the windows environment? > > 2. How to make the eu program wait until php.exe is finished? > > > ============================================== > _______<-------------------\__ > / _____<--------------------__|=== > | |_ <-------------------/ > \__| Patrick Barnes > > > -----Original Message----- > From: Derek Parnell [mailto:ddparnell at bigpond.com] > Sent: Tuesday, 26 November 2002 10:51 > To: EUforum > Subject: Re: Path pitfalls.... > > > Try using shellExecuteEx instead... > > shellExecuteEx( object verb, sequence file, object parms, > object defdir, atom style, atom struct) > > shellExecute("open", "bin\\php.exe > bin\\export1.html", "bin\\Cat.php", > 0, SW_SHOWNORMAL, 0) > > Or maybe its the stdout redirection causing it. > > On Tue, 26 Nov 2002 10:02:54 +1100, <Patrick.Barnes at transgrid.com.au> > wrote: > >> >> Damn, and I thought I'd figured it out, too. >> >> I got rid of all my system calls, and used shellExecute, but it didn't quite >> work. No doubt I'm making a mistake somewhere. >> >> This is my code for one php file. >> ----------------------------------------------------------------- >> --run the php script Cat, and output the results into export.html >> shellExecute("open", "bin\\php.exe bin\\Cat.php > bin\\export1.html", >> SW_SHOWNORMAL) >> >> --open export.html as read, and the other two files as write. >> s = open("BIN\\export1.html","r") >> d1 = open("Tier 3 Apps by Category.html","w") >> d2 = open("Tier_3_Apps_by_Category.asp","w") >> >> --strip out the top two lines. >> line = gets(s) >> line = gets(s) >> >> --Copy the rest across to the destination files >> --read a line in. >> line = gets(s) >> while sequence(line) do --while the source file does not end... >> puts(d1, line) --output that line to d1 >> puts(d2, line) --and d2 >> line = gets(s) --and get a new line >> end while >> >> --close those files >> close(s) >> close(d1) >> close(d2) >> ------------------------------------------------------------------- >> The other half of the program is almost identical. >> I thought it was working fine, but it turns out that the shellExecute command >> >> doesn't do anything. What am I doing wrong? >> ======================= >> Patrick Barnes >> Information Systems Group >> 201 Elizabeth St, Sydney >> Patrick.Barnes at tg.nsw.gov.au >> Ext: 91-3583 >> Ph:(02) 9284-3583 >> Mob: 0410 751 044 >> >> -----Original Message----- >> From: Derek Parnell [mailto:ddparnell at bigpond.com] >> Sent: Tuesday, 26 November 2002 09:07 >> To: EUforum >> Subject: Re: Path pitfalls.... >> >> >> Patrick, >> I did some quick research and discovered that even though the API docs say >> you need a parent window, you can get by with out one for shellExecute. >> So if you'd like to do a small mod on the win32lib.ew file.... >> <snip> -- cheers, Derek Parnell