Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 ( #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? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2022-01-26 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?