Advertisements

PclZipUtilCopyBlock

Definition:
function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)

Parameters

  • $p_src
  • $p_dest
  • $p_size
  • $p_mode

Source code

  function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)

  {

    $v_result = 1;



    if ($p_mode==0)

    {

      while ($p_size != 0)

      {

        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);

        $v_buffer = @fread($p_src, $v_read_size);

        @fwrite($p_dest, $v_buffer, $v_read_size);

        $p_size -= $v_read_size;

      }

    }

    else if ($p_mode==1)

    {

      while ($p_size != 0)

      {

        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);

        $v_buffer = @gzread($p_src, $v_read_size);

        @fwrite($p_dest, $v_buffer, $v_read_size);

        $p_size -= $v_read_size;

      }

    }

    else if ($p_mode==2)

    {

      while ($p_size != 0)

      {

        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);

        $v_buffer = @fread($p_src, $v_read_size);

        @gzwrite($p_dest, $v_buffer, $v_read_size);

        $p_size -= $v_read_size;

      }

    }

    else if ($p_mode==3)

    {

      while ($p_size != 0)

      {

        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);

        $v_buffer = @gzread($p_src, $v_read_size);

        @gzwrite($p_dest, $v_buffer, $v_read_size);

        $p_size -= $v_read_size;

      }

    }



    // ----- Return

    return $v_result;

  }

2489

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: