php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55775 fileperms() return value not documented on success
Submitted: 2011-09-24 19:18 UTC Modified: 2012-01-30 14:19 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: chealer at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chealer at gmail dot com
New email:
PHP Version: OS:

 

 [2011-09-24 19:18 UTC] chealer at gmail dot com
Description:
------------
http://ca2.php.net/manual/en/function.fileperms.php

fileperms() gets file permissions and returns them. However, the only thing the documentation says about the return value is:
Returns the permissions on the file, or FALSE on failure.

There is no hint of how file permissions are represented except in examples, which show that the return value contains more than permissions, and that it is returned as an integer related to UNIX file permissions modes.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-24 19:48 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=317254
Log: Fix doc bug #55775 (fileperms() return value not documented on success) by
linking to the chmod() page.
 [2011-09-24 19:48 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2011-09-24 19:48 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2011-09-24 19:49 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2011-09-24 22:08 UTC] chealer at gmail dot com
-Status: Closed +Status: Assigned
 [2011-09-24 22:08 UTC] chealer at gmail dot com
Thanks for the quick reaction Adam. Unfortunately r317254 introduces a regression. The return value of fileperms() is not what one may expect. It is merely *related* to the UNIX mode. For example, on a directory with mode 02775, fileperms() returned 042775. Without having read the source, my guess is that fileperms() returns an integer representing a string of the UNIX octal mode prepended with a digit representing the file type (4 in this case).

Also, although re-using the chmod documentation would seem natural, the chmod documentation is poor. It also assumes the reader is on UNIX.
 [2012-01-30 14:19 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=322937
Log: Re-fix doc bug #55775 (fileperms() return value not documented on success).
 [2012-01-30 14:19 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Good catch. Thanks!
 [2012-01-30 14:19 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 21:00:02 2026 UTC