Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    2

    Unanswered: how do you dup file descriptors in PERL?

    I have been searching for ways to manipulate file descriptors in PERL, but so far I have found that there is a lot of information about manipulating file handles, and next to none about file descriptors.

    What I need is a function that does the same thing as the UNIX shell dup2() function. There is no such function in PERL, escept for the fctrl() function, for which I have not been able to find any meanigful information.

    Can anyone please advise.

    Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    Germany, near Aachen
    Posts
    120
    Something like:

    open FILE1, ">/tmp/file1";
    open FILE2, ">&FILE1";

    should do what you want.

  3. #3
    Join Date
    Jul 2003
    Posts
    2
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •