in reply to Passing a filehandle from C to perl

This is a complex question. Perl is written in C so does this for you all the time to allow you to use files. Have a look at perlman:perlxs and perlman:perlguts for a free overview of all the nitty gritty. There is a new Manning book on Perl and C in the works but this will be a few months probably. If you search this site for 'XS' you will find some interesting threads that may be helpful.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

  • Comment on Re: Passing a filehandle from C to perl

Replies are listed 'Best First'.
Re: Re: Passing a filehandle from C to perl
by suaveant (Parson) on Jul 31, 2001 at 22:29 UTC
    Yes, but I just want to pass the filehandle on to basically a child process... either by a system("/usr/bin/perl test.pl"); or with exec in C, and be able to grab onto that filehandle and read from it. I mean, in the end this doesn't have to have anything to do with C and Perl, it could be Scheme and Python or whatnot (although I have no idea in the slightest what to do there).

    Basically what I want to do is have a C prog that sets it uid to the owner, opens a protected file, set itself back to its original UID and then runs a perl script, but allow that perl script access to the protected filehandle... am I crazy, or is this possible?

                    - Ant

      I don't know if you are crazy :-) and I am sure it is possible but I don't understand the logic for it, why not just do it all from Perl?

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print