<?php
Class fhandle {
	function fileopen($filename, $mode, $use_include_path = false) {
		return fopen($filename, $mode, $use_include_path);
	}
	
	function filegets($handle, $length) {
		if ($length==0) {
			return fgets($handle);
		} else {
			return fgets($handle, $length);
		}
	}
	
	function filetell($handle) {
		return ftell($handle);
	}
	
	function fileseek($handle, $offset, $whence = SEEK_SET) {
		return fseek($handle, $offset, $whence);
	}
	
	function fileclose($handle) {
		return fclose($handle);
	}
}

Class gzhandle {
	function fileopen($filename, $mode, $use_include_path = 0) {
		return gzopen($filename, $mode, $use_include_path);
	}
	
	function filegets($handle, $length) {
		if ($length==0) {
			return gzgets($handle);
		} else {
			return gzgets($handle, $length);
		}
	}
	
	function filetell($handle) {
		return gztell($handle);
	}
	
	function fileseek($handle, $offset, $whence = SEEK_SET) {
		return gzseek($handle, $offset, $whence);
	}
	
	function fileclose($handle) {
		return gzclose($handle);
	}
}
?>