Help for this page

Select Code to Download


  1. or download this
    int fd = open("/some/file", O_RDWR);
    dup2(fd, 7);
    close(fd);
    
  2. or download this
    int pid = fork();
    if (pid == 0) {
        execl("/the/perl/program", "program", "arg1", "etc");
        _exit("URK!");
    }
    close(7);
    
  3. or download this
    open FH, '+<=7';
    my $line = <FH>;       # or whatever