Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Win32: Setting a layer with binmode causes problem with close() on Windows (PerlIO silently fails to close the file)

by Anonymous Monk
on Jun 17, 2013 at 13:00 UTC ( [id://1039362]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Win32: Setting a layer with binmode causes problem with close() on Windows (PerlIO silently fails to close the file)
in thread Win32: Setting a layer with binmode causes problem with close() on Windows

something like this

sub system_detached { my $program; my @args ; my $cmdline; if( @_ > 1 ){ ( $program ) = @_; $cmdline = Win32::ShellQuote::quote_system_string( @_ ); } else { ( $cmdline ) = @_; } $!=$^E=0; my $ProcessObj; ## http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v= +vs.85).aspx# CreateProcess function (Windows) ## http://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v= +vs.85).aspx# Process Creation Flags (Windows) use Win32::ShellQuote(); use Win32::Process(); Win32::Process::Create( $ProcessObj, $program, $cmdline, 0, # don't inherit handles Win32::Process::DETACHED_PROCESS(), ".", #cwd ) or do { my $err = int($!).' '.$!." #### ".int($^E)." $^E "; warn "??CreateProcess failed (\$ProcessObj $ProcessObj) $err " +; return; }; return $ProcessObj; }
  • Comment on Re^5: Win32: Setting a layer with binmode causes problem with close() on Windows (PerlIO silently fails to close the file)
  • Download Code

Replies are listed 'Best First'.
Re^6: Win32: Setting a layer with binmode causes problem with close() on Windows (PerlIO silently fails to close the file)
by BrowserUk (Patriarch) on Jun 17, 2013 at 13:26 UTC

    Completely redundant and unnecessary.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Completely redundant and unnecessary.

      For this :unix issue, yes, probably, not for generic detached, system 1,... can be blocking

        system 1,... can be blocking

        Please elucidate? (Preferably demonstrate.)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-18 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found