Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^6: Win32API::File not setting HANDLE_FLAG_PROTECT_FROM_CLOSE (wrong layer)

by Yary (Pilgrim)
on Dec 05, 2012 at 16:14 UTC ( #1007315=note: print w/replies, xml ) Need Help??

in reply to Re^5: Win32API::File not setting HANDLE_FLAG_PROTECT_FROM_CLOSE (wrong layer)
in thread Win32API::File not setting HANDLE_FLAG_PROTECT_FROM_CLOSE

That works. Adding $ENV{myosh} = $os_handle; to the caller (also removing SetHandleInformation, it isn't needed) and rewriting as
use Win32API::File qw(OsFHandleOpen); OsFHandleOpen(\*OUT,$ENV{myosh},"w"); $x=print OUT "***\nHere is data to OsH $ENV{myosh}\n***\n"; warn "print=$x ($!)\n" unless $x;
works... Alas the "real" code I am dealing with that "" replaces is Unix-y C code. I have already made it use STDERR instead of its own stream, which is working well enough- if there's an error message then the stream is no good anyway, and in the usual case it's easier to manipulate STDERR .
  • Comment on Re^6: Win32API::File not setting HANDLE_FLAG_PROTECT_FROM_CLOSE (wrong layer)
  • Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007315]
[Corion]: shmem: Ooh, thanks! I already brought me an espresso+chocolate :)
[Discipulus]: mmh.. stil wrong
[Discipulus]: no sugar no milk, thanks; black short eatalian coffe
[Corion]: "corto" ;)
[Discipulus]: while (readdir DIR) was wrong too; it is while ($_ = readdir DIR)
[Corion]: Discipulus: I have to admit that nowadays I either use Path::Class or use File::Find or simply File::Glob:: bsd_glob to read a directory, depending on how fancy my needs are
[shmem]: Discipulus: while (readdir DIR) works fine

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-05-26 07:25 GMT
Find Nodes?
    Voting Booth?