Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^2: Open a file on a specific file descriptor?

by polettix (Vicar)
on Jan 02, 2008 at 10:25 UTC ( [id://659945]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    open my $fh, '<', '/dev/zero' or die "$!";
  2. or download this
    pipe my ($header_in, $header_out);
    pipe my ($body_in, $body_out);
  3. or download this
    use Fatal qw( close );
    close STDIN;
    close STDOUT;
    pipe my ($message_in, $message_out);
  4. or download this
    use strict;
    header_out has descriptor 5
    body_in has descriptor 6
    body_out has descriptor 7
  5. or download this
       while (1) {
          open my $fh, '<', '/dev/zero' or die "open(): $!";
          die "file descriptor $n not available" if fileno($fh) > $n;
          push @fakes, $fh;
       } ## end while (1)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://659945]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-07-19 03:42 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.