You are here

function PclZip::privOpenFd in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/pclzip/pclzip.lib.php \PclZip::privOpenFd()
6 calls to PclZip::privOpenFd()
PclZip::privAdd in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privCreate in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privDeleteByRule in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privDuplicate in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privExtractByRule in includes/moodle/lib/pclzip/pclzip.lib.php

... See full list

File

includes/moodle/lib/pclzip/pclzip.lib.php, line 2299

Class

PclZip

Code

function privOpenFd($p_mode) {

  //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode);
  $v_result = 1;

  // ----- Look if already open
  if ($this->zip_fd != 0) {

    // ----- Error log
    PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \'' . $this->zipname . '\' already open');

    // ----- Return

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
    return PclZip::errorCode();
  }

  // ----- Open the zip file

  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode');
  if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) {

    // ----- Error log
    PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \'' . $this->zipname . '\' in ' . $p_mode . ' mode');

    // ----- Return

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
    return PclZip::errorCode();
  }

  // ----- Return

  //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
  return $v_result;
}