PHP Velho Oeste 2024

posix_fpathconf

(PHP 8 >= 8.3.0)

posix_fpathconfReturns the value of a configurable limit

Beschreibung

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

Returns the value of a configurable limit from name for a file descriptor resource

Parameter-Liste

file_descriptor

Der Datei-Deskriptor, welcher entweder eine Datei-Ressource oder ein Wert vom Typ int sein sollte. Ist dies ein int, dann wird davon ausgegangen, dass es sich um einen Dateideskriptor handelt, welcher direkt an den zugrundeliegenden Systemaufruf übergeben werden kann.

name

The name of the configurable limit, one of the following. POSIX_PC_LINK_MAX, POSIX_PC_MAX_CANON POSIX_PC_MAX_INPUT, POSIX_PC_NAME_MAX POSIX_PC_PATH_MAX, POSIX_PC_PIPE_BUF POSIX_PC_CHOWN_RESTRICTED, POSIX_PC_NO_TRUNC POSIX_PC_ALLOC_SIZE_MIN, POSIX_PC_SYMLINK_MAX

Rückgabewerte

Returns the configurable limit or false.

Fehler/Exceptions

Throws a ValueError when resource is invalid.

Beispiele

Beispiel #1 posix_fpathconf() example

This example will get 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);
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

4096

Anmerkungen

Siehe auch

add a note add a note

User Contributed Notes

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