in reply to (tye)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...
The 'e' portion of the "rwe" arg to createFile() causes an error if the file doesn't already exist, which is the behavior I want. If the pipe server isn't running, I need to know.my $hPipe = createFile( $PIPE_NAME, "rwe" ) or die "Can't read from [$PIPE_NAME]: $^E\n"; $^E = 0; # Clear possibly misleading errors out. no strict 'subs'; OsFHandleOpen( PIPE, $hPipe, "rw" ) or die "Can't associate Perl handle: $! ($^E)\n"; use strict 'subs';
I expect there's a better way to quiet the complaint about the filehandle being a bareword, too.
Since I'm not reporting $^E unless there's an error, is it necessary to clear it ahead of time?
Thanks for the prompt answer to something that turned out trickier than I thought.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tye, that does the job.
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 |