posix_pathconf
Description
The posix_pathconf of POSIX for PHP returns the value of a configurable limit.
Syntax
posix_pathconf( string $path, int $name ): int|false
Parameters
path
The name of the file whose limit you want to get.
name
The name of the configurable limit, one of the following:
Constant | Description |
---|---|
POSIX_PC_LINK_MAX | The maximum number of links a given file or directory can have. |
POSIX_PC_MAX_CANON | The maximum number of bytes in a terminal canonical input buffer (pathname being then a character special file). |
POSIX_PC_MAX_INPUT | The maximum number of bytes of a terminal input queue (pathname being then a character special file). |
POSIX_PC_NAME_MAX | The maximum number of characters for a file name alone, not its path. |
POSIX_PC_PATH_MAX | The maximum number of characters for a full path name. |
POSIX_PC_PIPE_BUF | The maximum number of bytes that can be written to a pipe in one operation. |
POSIX_PC_CHOWN_RESTRICTED | If privileges are required to be allow chown() to work. |
POSIX_PC_NO_TRUNC | If a file name (or files under a directory) is longer than POSIX_PC_NAME_MAX. |
POSIX_PC_ALLOC_SIZE_MIN | The minimum number of bytes of storage allocated for any portion of a file. |
POSIX_PC_SYMLINK_MAX | The maximum number of symbolic links a given file or directory can have. |
Return
Returns the configurable limit or false.
Examples
1 · path name · POSIX_PC_LINK_MAX
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_LINK_MAX; $return = posix_pathconf($path, $name); echo $return;
65000
2 · path name · POSIX_PC_MAX_CANON
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_MAX_CANON; $return = posix_pathconf($path, $name); echo $return;
255
3 · path name · POSIX_PC_MAX_INPUT
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_MAX_INPUT; $return = posix_pathconf($path, $name); echo $return;
255
4 · path name · POSIX_PC_NAME_MAX
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_NAME_MAX; $return = posix_pathconf($path, $name); echo $return;
255
5 · path name · POSIX_PC_PATH_MAX
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_PATH_MAX; $return = posix_pathconf($path, $name); echo $return;
4096
6 · path name · POSIX_PC_PIPE_BUF
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_PIPE_BUF; $return = posix_pathconf($path, $name); echo $return;
4096
7 · path name · POSIX_PC_CHOWN_RESTRICTED
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_CHOWN_RESTRICTED; $return = posix_pathconf($path, $name); echo $return;
1
8 · path name · POSIX_PC_NO_TRUNC
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_NO_TRUNC; $return = posix_pathconf($path, $name); echo $return;
1
9 · path name · POSIX_PC_ALLOC_SIZE_MIN
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_ALLOC_SIZE_MIN; $return = posix_pathconf($path, $name); echo $return;
4096
10 · path name · POSIX_PC_SYMLINK_MAX
<? $path = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $name = POSIX_PC_SYMLINK_MAX; $return = posix_pathconf($path, $name); echo $return;
Links
POSIX
- posix_access
- posix_ctermid
- posix_eaccess
- posix_errno
- posix_fpathconf
- posix_get_last_error
- posix_getcwd
- posix_getegid
- posix_geteuid
- posix_getgid
- posix_getgrgid
- posix_getgrnam
- posix_getgroups
- posix_getlogin
- posix_getpgid
- posix_getpgrp
- posix_getpid
- posix_getppid
- posix_getpwnam
- posix_getpwuid
- posix_getrlimit
- posix_getsid
- posix_getuid
- posix_initgroups
- posix_isatty
- posix_kill
- posix_mkfifo
- posix_mknod
- posix_setegid
- posix_seteuid
- posix_setgid
- posix_setpgid
- posix_setrlimit
- posix_setsid
- posix_setuid
- posix_strerror
- posix_sysconf
- posix_times
- posix_ttyname
- posix_uname