Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Win32::Process::Create fails when i use ">" to redirect the screen output to a file

by prayaspatel (Initiate)
on Aug 28, 2012 at 01:14 UTC ( #990107=note: print w/ replies, xml ) Need Help??


in reply to Win32::Process::Create fails when i use ">" to redirect the screen output to a file

Any help would be appreciated for above question....i can provide more information if you want


Comment on Re: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
Re^2: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
by james2vegas (Chaplain) on Aug 28, 2012 at 01:36 UTC
    I am open to correction, but I believe that > would not be a part of the command line passed to notepad, but rather would be passed to your shell (cmd.exe, cygwin's sh, whatever).

    Also I don't think that notepad.exe actually outputs anything to the console under usual circumstances, being a completely GUI application.

    I do not believe cmd.exe supports 2>&1 style redirects (apparently it does, see here, thanks for the headsup), so you would have to be using cygwin's sh or perhaps SUA perl. In that case, why aren't you just using system, qx or open?
      Hi,
      Just a minor correction - cmd.exe *does* support 2>&1 (and the like) redirection.

      Cheers,
      Rob
      i am using tool.exe but i just mentioned notepad.exe to give as an example. sorry about that. when i only put tool.exe without putting "> log.txt 2>&1" in Win32::Process::Create() it works fine.

      Also, i can run "tool.exe > log.txt 2>&1" directly from commandline but when i try to use it using Win32::Process::Create() its giving those errors that i mentioned in my initial question.

Re^2: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
by Anonymous Monk on Aug 28, 2012 at 02:29 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990107]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2014-10-01 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (27 votes), past polls