Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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 ( #990109=note: print w/ replies, xml ) Need Help??


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

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?


Comment on Re^2: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
Select or Download Code
Re^3: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
by syphilis (Canon) on Aug 28, 2012 at 03:04 UTC
    Hi,
    Just a minor correction - cmd.exe *does* support 2>&1 (and the like) redirection.

    Cheers,
    Rob
Re^3: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
by prayaspatel (Initiate) on Aug 28, 2012 at 17:59 UTC
    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-08-20 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (105 votes), past polls