Skip to content

[PHP 8.3] posix: amendments and stub pages for new functions#2925

Closed
Girgias wants to merge 1 commit into
php:masterfrom
Girgias:posix-8.3-stubs
Closed

[PHP 8.3] posix: amendments and stub pages for new functions#2925
Girgias wants to merge 1 commit into
php:masterfrom
Girgias:posix-8.3-stubs

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented Nov 7, 2023

@devnexen as you know the most about POSIX could you help writing the documentation?

@Girgias Girgias added this to the PHP 8.3 milestone Nov 7, 2023
@devnexen
Copy link
Copy Markdown
Member

devnexen commented Nov 7, 2023

I ll get to it sometime this week.

</methodsynopsis>
&warn.undocumented.func;
<para>
Description.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<function>posix_eaccess</function> checks the effective user's permission of a file.

<term><parameter>filename</parameter></term>
<listitem>
<para>
Description.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of a file to be tested.

<term><parameter>flags</parameter></term>
<listitem>
<para>
Description.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<para>
        A mask consisting of one or more of <constant>POSIX_F_OK</constant>,
        <constant>POSIX_R_OK</constant>, <constant>POSIX_W_OK</constant> and
        <constant>POSIX_X_OK</constant>.
       </para>
       <para>
        <constant>POSIX_R_OK</constant>, <constant>POSIX_W_OK</constant> and
        <constant>POSIX_X_OK</constant> request checking whether the file
        exists and has read, write and execute permissions, respectively.
        <constant>POSIX_F_OK</constant> just requests checking for the
        existence of the file.
       </para>

<example xml:id="function.posix-eaccess.example.basic">
<title><function>posix_eaccess</function> example</title>
<para>
Description.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<para>
   <example>
    <title><function>posix_eaccess</function> example</title>
    <para>
     This example will check if the $file is readable and writable, otherwise
     will print an error message.
    </para>
    <programlisting role="php">
<![CDATA[
<?php

$file = 'some_file';

if (posix_eaccess($file, POSIX_R_OK | POSIX_W_OK)) {
    echo 'The file is readable and writable!';

} else {
    $error = posix_get_last_error();

    echo "Error $error: " . posix_strerror($error);
}

?>
]]>

</row>
</thead>
<tbody>
<row>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<row>
      <entry>8.3.0</entry>
      <entry>
       Checks the effective user/group for a file, differing
       from <function>posix_access</function> which checks
       from the real user/group.
      </entry>
     </row>

@Girgias
Copy link
Copy Markdown
Member Author

Girgias commented Nov 10, 2023

Superseded by #2928 2928

@Girgias Girgias closed this Nov 10, 2023
@Girgias Girgias deleted the posix-8.3-stubs branch November 10, 2023 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants