September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool is_writeable(string filename) Checks whether a file is writeable.
Returns:
TRUE if writeable; FALSE otherwise
Description:
Checks whether the specified file is writeable by PHP. Note that depending on how the script is executed (command line, CGI, module), the test may be performed with varying user IDs, so permissions may affect the result of the function. Safe mode restrictions are not taken into account.
Note:
The results of this function are cached. See clearstatcache() for details.
Example:
$file = "testfile";
if(is_writeable($file))
{
// open and write to file
}
else
{
echo ("Cannot write to file $file.");
}
|
Read now
Unlock full access