getid3_lib::CopyFileParts

Advertisement

Deprecated Deprecated

This method has been deprecated. Unused, may be removed in future versions of getID3 instead.

Syntax Syntax

getid3_lib::CopyFileParts( string $filename_source, string $filename_dest, int $offset, int $length )

Parameters Parameters

$filename_source

(string) (Required)

$filename_dest

(string) (Required)

$offset

(int) (Required)

$length

(int) (Required)

Return Return

(bool)

Source Source

File: wp-includes/ID3/getid3.lib.php

		}
		if (is_readable($filename_source) && is_file($filename_source) && ($fp_src = fopen($filename_source, 'rb'))) {
			if (($fp_dest = fopen($filename_dest, 'wb'))) {
				if (fseek($fp_src, $offset) == 0) {
					$byteslefttowrite = $length;
					while (($byteslefttowrite > 0) && ($buffer = fread($fp_src, min($byteslefttowrite, getID3::FREAD_BUFFER_SIZE)))) {
						$byteswritten = fwrite($fp_dest, $buffer, $byteslefttowrite);
						$byteslefttowrite -= $byteswritten;
					}
					fclose($fp_dest);
					return true;
				} else {
					fclose($fp_src);
					throw new Exception('failed to seek to offset '.$offset.' in '.$filename_source);
				}
			} else {
				throw new Exception('failed to create file for writing '.$filename_dest);
			}
		} else {
			throw new Exception('failed to open file for reading '.$filename_source);
		}
	}

	/**
	 * @param int $charval

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.