Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199903

Re: [PHP3] is_writeable From: Bo Meyer (bmeyer <email protected>)
Date: 03/31/99

>I know about is-writeable, but it will only tell me if a file is writeable
>if it exists before-hand. I'd like to find out if a file is writeable
>without it existing; ie confirm that a directory will allow me to write
>there before I try and create the file.

What about:

<?
 function myown_is_writeable($filename) {
  if (file_exists($filename))
   return is_writeable($filename);
  else {
   @$fp = fopen($filename,"w");
   if ($fp) {
    fclose($fp);
    unlink($filename);
    return true;
   }
    else
     return false;
  }
 }
?>

Regards

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>