From dc9f5014c298fe28983d024ad2d9e5d04b7f1dfa Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 1 May 2008 15:40:36 +0000 Subject: Marcus Povey * Added tell git-svn-id: https://code.elgg.org/elgg/trunk@606 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/filestore.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'engine/lib') diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index d1186dea7..662bf81ec 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -65,6 +65,14 @@ */ abstract public function eof($f); + /** + * Return the current position in an open file. + * + * @param mixed $f The file handle. + * @return int + */ + abstract public function tell($f); + /** * Close a given file handle. * @@ -198,6 +206,11 @@ return fseek($f, $position); } + public function tell($f) + { + return ftell($f); + } + public function eof($f) { return feof($f); @@ -435,6 +448,18 @@ return $fs->seek($this->handle, $position); } + + /** + * Return the current position of the file. + * + * @return int The file position + */ + public function tell() + { + $fs = $this->tell(); + + return $fs->tell($this->handle); + } /** * Return the size of the file in bytes. -- cgit v1.2.3