I'd like to create a perl script that creates a pseudo-device that shuffles data to-and-from /dev/sg0, making some minor tweaks to the data along the way.

I can't find the CPAN module that does this.

A friend has shown me how to use ioctl to talk to things like /dev/sg0 with perl, but I don't see how to make perl listen to something as if it were a device.

I'm guessing the pseudo-device would be a FIFO, lets call it /dev/psg0. I'd like to be able to do "sg_ses -p 2 /dev/psg0", and have a perl script listen to what sg_ses sends via /dev/psg0, tweak it a bit and send it on to /dev/sg0, take the response from /dev/sg0 and send it back to sg_ses via /dev/psg0.


In reply to device I/O interceptor by tom93

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.