[pLog-svn] about isWritable()

Jon Daley plogworld at jon.limedaley.com
Thu Apr 6 20:06:57 GMT 2006


Hrm,

   posix_access: (PHP 5 >= 5.1.0RC1)

On Fri, 7 Apr 2006, Mark Wu wrote:
> 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
>

**************************************
Jon Daley
http://jon.limedaley.com/

Failure to prepare is preparing to fail.
-- Unknown


More information about the pLog-svn mailing list