略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: posix_fpathconf

2025-02-27

posix_fpathconf

(PHP 8 >= 8.3.0)

posix_fpathconfReturns the value of a configurable limit

说明

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

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

参数

file_descriptor

The file descriptor, which is expected to be either a file resource 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_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.

返回值

Returns the configurable limit or false.

错误/异常

Throws a ValueError when resource is invalid.

示例

示例 #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);
?>

以上示例会输出:

4096

参见

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。

官方地址:https://www.php.net/manual/en/function.posix-fpathconf.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3