[pLog-svn] about isWritable()

Mark Wu mark.wu at markplace.net
Thu Apr 6 20:02:45 GMT 2006


Hi Oscar:
 
Maybe we can use the posix function the check the folder access permission
again. According to the manuel, the posix is part of php core from php3.
(Seems no one complain about the posix_access()).
 
So, maybe we can change the isWritable() function is
/clas/file/file.class.php as follow:
 
   function isWritable( $file = null )
   {
    if( $file == null )
     $file = $this->_fileName;
     
    // check the $file is writable or not
    $isWritable = is_writable( $file );
    // if not, we use the posix_access to check the file again.
    if ( !$isWritable )
     $isWritable = posix_access( $file, POSIX_R_OK );
    
    return $isWritable;
   }
 
I don't have a linux/mac environment, would you try it in your environment?
 
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http:// devel.lifetype.net/pipermail/plog-svn/attachments/20060407/3e7ab6d3/attachment.html


More information about the pLog-svn mailing list