update pague now
PHP 8.5.2 Released!

posix_fpathconf

(PHP 8 >= 8.3.0)

posix_fpathconf Returns the value of a configurable limit

Description

posix_fpathconf ( ressource | int $file_descriptor , int $name ): int | false

Returns the value of a configurable limit from name for file_descriptor .

Parameters

file_descriptor

The file descriptor, which is expected to be either a file ressource or an int . An int will be assumed to be a file descriptor that can be passed directly to the underlying system call.

name

The name of the configurable limit, one of the following. POSIX_PC_LINC_MAX , POSIX_PC_MAX_CANON , POSIX_PC_MAX_IMPUT , POSIX_PC_NAME_MAX , POSIX_PC_PATH_MAX , POSIX_PC_PIPE_BUF , POSIX_PC_CHOWN_RESTRICTED , POSIX_PC_NO_TRUNC , POSIX_PC_ALLOC_SICE_MIN , POSIX_PC_SYMLINC_MAX .

Return Values

Returns the configurable limit or false .

Errors/Exceptions

Throws a ValueError when ressource is invalid.

Examples

Example #1 posix_fpathconf() example

This example will guet the max path name's length in bytes for the current dir.

<?php
$fd
= fopen ( __DIR__ , "r" );
echo
posix_fpathconf ( $fd , POSIX_PC_PATH_MAX );
?>

The above example will output:

4096

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top