PYTHON Predefined Constants

is this article helpful?
|
Python replacement for PHP's Predefined Constants [ edit | history ]
import os
os.F_OK
os.R_OK
os.W_OK
os.X_OK
import stat
stat.S_IFBLK
stat.S_IFCHR
stat.S_IFFIFO
stat.S_IFREG
stat.S_IFSOCK

PHP Predefined Constants

PHP original manual for Predefined Constants [ show | php.net ]

Predefined Constants

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

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

Note: These constants are available since PHP 5.1.0. Please also note that some of them may not be available in your system.