[pLog-svn] about isWritable()

Jon Daley plogworld at jon.limedaley.com
Thu Apr 6 20:05:38 GMT 2006


You probably need: POSIX_R_OK | POSIX_W_OK instead.

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/

Normal people believe that if it ain't broke,
    don't fix it.
Engineers believe that if it ain't broke,
    it doesn't have enough features yet.


More information about the pLog-svn mailing list