getid3_handler::fseek() –

You appear to be a bot. Output may be restricted

Description

Usage

$int = getid3_handler::fseek( $bytes, $whence );

Parameters

$bytes
( int ) required
$whence
( int ) optional default: SEEK_SET –

Returns

int

Source

File name: wordpress/wp-includes/ID3/getid3.php
Lines:

1 to 35 of 35
  protected function fseek($bytes, $whence=SEEK_SET) {
    if ($this->data_string_flag) {
      switch ($whence) {
        case SEEK_SET:
          $this->data_string_position = $bytes;
          break;

        case SEEK_CUR:
          $this->data_string_position += $bytes;
          break;

        case SEEK_END:
          $this->data_string_position = $this->data_string_length + $bytes;
          break;
      }
      return 0; // fseek returns 0 on success
    }

    $pos = $bytes;
    if ($whence == SEEK_CUR) {
      $pos = $this->getid3_handler::ftell() + $bytes;
    } elseif ($whence == SEEK_END) {
      $pos = $this->getid3->info['filesize'] + $bytes;
    }
    if (!getid3_lib::intValueSupported($pos)) {
      throw new getid3_exception('cannot fseek('.$pos.') because beyond PHP filesystem limit', 10);
    }

    // https://github.com/JamesHeinrich/getID3/issues/327
    $result = fseek($this->getid3->fp, $bytes, $whence);
    if ($result !== 0) { // fseek returns 0 on success
      throw new getid3_exception('cannot fseek('.$pos.'). resource/stream does not appear to support seeking', 10);
    }
    return $result;
  }
 

 View on GitHub View on Trac