in reply to Re: How do I open a r/w named pipe as a file? *Should* be simple...
in thread How do I open a r/w named pipe as a file? *Should* be simple...
Ah, a Win32 named pipe (in Unix it is trivial). Fetch Win32API::File (if it didn't come with your copy of Perl) and you can do this:
and then just use FILE like you would any old Perl file handle. (See the module documentation for more details like how to open the pipe for write access or for read/write access, etc.) - tye (but my friends call me "Tye")use Win32API::File qw( createFile OsFHandleOpen ); my $h= createFile( "//./pipe/MyPipe", "r" ) or die "Can't read from pipe/MyPipe: $^E\n"; $^E= 0; # Clear possibly misleading errors out. OsFHandleOpen( FILE, $h, "r" ) or die "Can't associate Perl handle: $! ($^E)\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Tye, that does the job.
by Coleoid (Sexton) on Mar 29, 2001 at 03:04 UTC | |
by tye (Sage) on Mar 29, 2001 at 03:06 UTC | |
by Coleoid (Sexton) on Mar 29, 2001 at 06:02 UTC | |
by tye (Sage) on Mar 29, 2001 at 07:20 UTC | |
by Coleoid (Sexton) on Mar 29, 2001 at 07:51 UTC | |
by Coleoid (Sexton) on Mar 29, 2001 at 23:51 UTC |