Bug 122391 - Polling pipes fails on Fedora. Example provided
Summary: Polling pipes fails on Fedora. Example provided
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-DBI
Version: 3
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Warren Togami
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-05-03 22:46 UTC by Ray Gwinn
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-04-17 17:24:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ray Gwinn 2004-05-03 22:46:46 UTC
Polling pipes does not seem to work correctly on Fedora 1.  Two perl
scripts follow that demonstrate the problem.

The below scripts work on all distros that I have tested, including 
RH9, but fails on Fedora 1.  I have not tried the test Fedora 2.

Ray

#!/usr/local/bin/perl -w
# This script is called "test.pl" and is run in the pipe.

use strict;
$| = 1;

print "out1\n";
sleep 3;
print "out2\n";
sleep 3;
print "out3\n";
sleep 3;
print "out4\n";
exit;

Following is a script that invokes the above script.

#!/usr/local/bin/perl -w
# This script polls a command pipe by checking the filesize
# of the pipe's file handle.
use Tk;
use strict;

my $MW = MainWindow->new;
my $txt = $MW->Text->pack;

open (MY_PIPE, "test.pl |") or die "Couldn't open: $!\n";
my $pipe = \*MY_PIPE;

$MW->repeat(50 => \&read_pipe);

MainLoop;

sub read_pipe {
   # Read from the pipe if data is present there.
   my $size = -s $pipe;
   if ($size) {
      my $line;
      sysread($pipe,$line,$size);
      return unless $line;
      $txt->insert('end', "$line");
      $MW->update;
   }
}

Comment 1 Ray Gwinn 2004-05-11 16:01:40 UTC
I have now tested the pipe polling problem on Fedora 2, test 3.  The 
problem still exists.

Ray


Comment 2 Warren Togami 2005-09-09 03:13:35 UTC
What about FC4?


Note You need to log in before you can comment on or make changes to this bug.