Hello!

I'm trying to use the mkfifo function from the POSIX module. I'm seeing inconsitencies with how it implements the 'mode' portion of the command.

If I use a mode of 0444 or 0555, then mkfifo behaves exactly as expected - the pipe is create with perms of 0444 or 055. However, if I use mkfifo with a mode of 0666 or 0777, then it doesn't work as expected.

Using a mode of 0666 actually creates a pipe with 0644. Using a mode of 0777 creates a pipe with 0755.

Is this a bug? Or is it just some behaviour that I don't understand?

Below is an illustration of what I'm seeing.

Perl version 5.8.8 on Kubuntu linux.

Thanks!

hmcm@helen:~$ perl -e 'use POSIX; mkfifo("four", 0444);' hmcm@helen:~$ ls -l four pr--r--r-- 1 hmcm hmcm 0 2007-10-25 13:33 four hmcm@helen:~$ perl -e 'use POSIX; mkfifo("five", 0555);' hmcm@helen:~$ ls -l five pr-xr-xr-x 1 hmcm hmcm 0 2007-10-25 13:34 five hmcm@helen:~$ perl -e 'use POSIX; mkfifo("six", 0666);' hmcm@helen:~$ ls -l six prw-r--r-- 1 hmcm hmcm 0 2007-10-25 13:35 six hmcm@helen:~$ perl -e 'use POSIX; mkfifo("seven", 0777);' hmcm@helen:~$ ls -l seven prwxr-xr-x 1 hmcm hmcm 0 2007-10-25 13:36 seven

In reply to bug in POSIX mkfifo? by Anonymous Monk

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.