PHP Classes

File: Files.inc.php

Recommend this page to a friend!
  Classes of Alexander Zhukov  >  PHP Shelve  >  Files.inc.php  >  Download  
File: Files.inc.php
Role: ???
Content type: text/plain
Description: File object passed to Pickle/Unpicle object
Class: PHP Shelve
Simple persistence mechanism for php objects
Author: By
Last change:
Date: 20 years ago
Size: 524 bytes
 

Contents

Class file image Download
<? // (C) 2002, Alexander Zhukov <alex@veresk.ru> class File { var $_file; function File($file) { $this->_file = $file; } function read() { $fh = @fopen($this->_file,"rb"); $str = @fread($fh,filesize($this->_file)); @fclose($fh); return $str; } function write($str) { $fh = @fopen($this->_file,"wb"); @fwrite($fh,$str); @fclose($fh); } function exists() { return @is_file($this->_file); } function delete() { @unlink($this->_file); } } ?>