php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #16771 posix_mkfifo() not properly documented
Submitted: 2002-04-23 17:47 UTC Modified: 2002-04-23 18:37 UTC
From: sean at caedmon dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0CVS-2002-04-23 OS: Linux 2.2.x (Debian)
Private report: No CVE-ID: None
 [2002-04-23 17:47 UTC] sean at caedmon dot net
posix_mkfifo('./FORK_FIFO', '0666'); // read&write by everyone

yeilds:
p-w---x--T    1 sean     sean            0 Apr 23 17:47 FORK_FIFO

?

it SHOULD yeild:
prw-rw-rw-

The only way for me to get rw, it seems, is with '900', which gives:
prw----r-T    1 sean     sean            0 Apr 23 17:48 FORK_FIFO

(note: I don't even know what T is..)
It's messed up, to say the least.

S

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 17:58 UTC] jr-php at quo dot to
This is a usage error. You need to remove the quotes from around 0666.
 [2002-04-23 18:01 UTC] sean at caedmon dot net
Partially true (I tried it without the quotes before I updated from cvs today):

posix_mkfifo('./FORK_FIFO', 666);
now gives:
prw-r--r--    1 sean     sean            0 Apr 23 18:00 FORK_FIFO

better, but still not correct.

S
 [2002-04-23 18:17 UTC] mfischer@php.net
This is a user error. First, only the mode without the quotes INCLUDING the leading zero (because it actually needs to be octal). Second, the actual permission the fifo gets created under also depends on your umask (which is likely to be something like 0022). If you change your umask to 0000 and use 0666 it will work.

I'll reclassify this as a documentation problem because it's not really documented.
 [2002-04-23 18:17 UTC] jr-php at quo dot to
That's probably because of the process's umask. Try:

posix_mkfifo('./FORK_FIFO', 0666);
chmod('./FORK_FIFO', 0666);
 [2002-04-23 18:37 UTC] mfischer@php.net
It's now documented too, closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 12:01:27 2024 UTC