PHP: POSIX Functions - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

posix_access zend_version

Last updated: Fri, 26 Jan 2007

view this page in

# CXXII. POSIX Functions

# Введение

This module contains an interface to those functions defined in the IEEE 1003.1 (POSIX.1) standards document which are not accessible through other means. POSIX.1 for example defined the open(), read(), write() and close() functions, too, which traditionally have been part of PHP 3 for a long time. Some more system specific functions have not been available before, though, and this module tries to remedy this by providing easy access to these functions.

Внимание
Sensitive data can be retrieved with the POSIX functions, e.g. posix_getpwnam() and friends. None of the POSIX function perform any kind of access checking when safe mode is enabled. It's therefore strongly advised to disable the POSIX extension at all (use `--disable-posix` in your configure line) if you're operating in such an environment.

> Замечание: Для Windows-платформ это расширение недоступно.

# Установка

POSIX functions are enabled by default. You can disable POSIX-like functions with `--disable-posix`.

# Предопределенные константы

Перечисленные ниже константы определены данным расширением и могут быть доступны только в том случае, если PHP был собран с поддержкой этого расширения или же в том случае, если данное расширение подгружается во время выполнения.

`POSIX_F_OK` (integer)

  Check whether the file exists.

`POSIX_R_OK` (integer)

  Check whether the file exists and has read permissions.

`POSIX_W_OK` (integer)

  Check whether the file exists and has write permissions.

`POSIX_X_OK` (integer)

  Check whether the file exists and has execute permissions.

`POSIX_S_IFBLK` (integer)

  Block special file

`POSIX_S_IFCHR` (integer)

  Character special file

`POSIX_S_IFIFO` (integer)

  FIFO (named pipe) special file

`POSIX_S_IFREG` (integer)

  Normal file

`POSIX_S_IFSOCK` (integer)

  Socket

> Замечание: These constants are available since PHP 5.1.0. Please also note that some of them may not be available in your system.

# Смотрите также

The section about Process Control Functions maybe of interest for you.

add a note User Contributed Notes
POSIX Functions
roberto at spadim dot com dot br
02-Oct-2006 09:36
`don't forget that in posix systems you can use /proc/$process_id/
files:
auxv
cmdline
cwd
environ
exe
fd
maps
mem
mounts
root
stat
statm
status
task
wchan
with it you can make somethings like:
$PPID=getmypid();
$pid=pcntl_fork();
if ($pid==0){
while(1){
if (strpos(file_get_contents("/proc/$PPID/cmdline"),'php')===false) echo "parent pid die";
}
}else{
// forked
}
with this you can use some libs that block signal or some bad signal handling or zombies process or anything you can think :)`
add a note
posix_access zend_version

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 11:33:19 2007 PST