is_writeable example

        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
            && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {

            PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,
                                 "Filename '".$p_entry['filename']."' is "
                                 ."already used by an existing directory");

            return PclZip::errorCode();
            }
      }
      // ----- Look if file is write protected       else if (!is_writeable($p_entry['filename']))
      {

        // ----- Change the file status         $p_entry['status'] = "write_protected";

        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR         // For historical reason first PclZip implementation does not stop         // when this kind of error occurs.         if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
            && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {

            
$ret = true;
        if (isset($create_parents)) {
            foreach ($opts[1] as $dir) {
                $dirstack = array();
                while ((!file_exists($dir) || !is_dir($dir)) &&
                        $dir != DIRECTORY_SEPARATOR) {
                    array_unshift($dirstack$dir);
                    $dir = dirname($dir);
                }

                while ($newdir = array_shift($dirstack)) {
                    if (!is_writeable(dirname($newdir))) {
                        $ret = false;
                        break;
                    }

                    if (!mkdir($newdir$mode)) {
                        $ret = false;
                    }
                }
            }
        } else {
            foreach($opts[1] as $dir) {
                
return false;
                    }
                    if (($this->_isArchive($v_header['filename']))
                        && ($v_header['typeflag'] == "5")
                    ) {
                        $this->_error(
                            'Directory ' . $v_header['filename']
                            . ' already exists as a file'
                        );
                        return false;
                    }
                    if (!is_writeable($v_header['filename'])) {
                        $this->_error(
                            'File ' . $v_header['filename']
                            . ' already exists and is write protected'
                        );
                        return false;
                    }
                    if (filemtime($v_header['filename']) > $v_header['mtime']) {
                        // To be completed : An error or silent no replace ?                     }
                } // ----- Check the directory availability and create it if necessary                 elseif (($v_result
                        =
Home | Imprint | This part of the site doesn't use cookies.