From 172603e9d31436ecc2ad12f48cd8f26ad8d033f5 Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 1 May 2008 15:33:02 +0000 Subject: Marcus Povey * Added eof functionality to datastore git-svn-id: https://code.elgg.org/elgg/trunk@605 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/filestore.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'engine/lib') diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index 62de55b9e..d1186dea7 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -57,6 +57,14 @@ */ abstract public function seek($f, $position); + /** + * Return a whether the end of a file has been reached. + * + * @param mixed $f The file handle. + * @return boolean + */ + abstract public function eof($f); + /** * Close a given file handle. * @@ -190,6 +198,11 @@ return fseek($f, $position); } + public function eof($f) + { + return feof($f); + } + public function getFileSize(ElggFile $file) { $name = $file->getFilename(); @@ -431,6 +444,16 @@ return $this->filestore->getFileSize($this); } + /** + * Return a boolean value whether the file handle is at the end of the file + */ + public function eof() + { + $fs = $this->getFilestore(); + + return $fs->eof($this->handle); + } + /** * Set a filestore. * -- cgit v1.2.3