★ wanayoo — archive 1999 http://fr.php.net/manual/en/function.is-writable.phpNouvelle recherche | Portail wanayoo
PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousis_uploaded_fileis_writeablenext
Last updated: Thu, 14 Nov 2002
view the printer friendly version or the printer friendly version with notes or change language to Brazilian Portuguese | Czech | Dutch | Finnish | French | German | Italian | Japanese | Korean | Polish | Romanian | Russian | Slovak | Spanish | Swedish | Turkish

is_writable

(PHP 4 )

is_writable -- Tells whether the filename is writable

Description

bool is_writable ( string filename)

Returns TRUE if the filename exists and is writable. The filename argument may be a directory name allowing you to check if a directory is writeable.

Keep in mind that PHP may be accessing the file as the user id that the web server runs as (often 'nobody'). Safe mode limitations are not taken into account.

The results of this function are cached. See clearstatcache() for more details.

This function will not work on remote files; the file to be examined must be accessible via the server's filesystem.

See also is_readable().

User Contributed Notes
is_writable
add a note about notes
syslogd at firemail dot de
12-Jun-2002 08:57

in my script, i did this:

while( !is_writeable( "entries.txt" )  )
{
clearstatcache();
sleep( 1 );
}

this worked local on my machine running winxp and apache 1.3x with php3/4 support. but on the webserver, it ran into an endless loop...
the solution:

while( !is_writeable( "entries.txt" ) && file_exists( "entries.txt") )
{
clearstatcache();
sleep( 1 );
}

michael

add a note about notes
previousis_uploaded_fileis_writeablenext
Last updated: Thu, 14 Nov 2002
show source | credits | stats | mirror sites
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: nexen.net
Last updated: Wed Nov 20 04:09:43 2002 CET