summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-12-18 15:40:43 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-12-18 15:41:40 +0100
commitd9668977cd23a3989a412ba3412240bf3cf38c94 (patch)
tree9375147ee0d4142435587e975a35231713d9f484 /apps/files_encryption
parentc955381d5691be00053e52a0e43df698478d979c (diff)
downloadnextcloud-server-d9668977cd23a3989a412ba3412240bf3cf38c94.tar.gz
nextcloud-server-d9668977cd23a3989a412ba3412240bf3cf38c94.zip
implement ftell stream wrapper and fix return value from fseek stream wrapper
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/lib/stream.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index 7a37d2200a4..c3cbdd54f56 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -164,14 +164,25 @@ class Stream {
}
/**
+ * @brief Returns the current position of the file pointer
+ * @return int position of the file pointer
+ */
+ public function stream_tell() {
+ return ftell($this->handle);
+ }
+
+ /**
* @param $offset
* @param int $whence
+ * @return bool true if fseek was successful, otherwise false
*/
public function stream_seek($offset, $whence = SEEK_SET) {
$this->flush();
- fseek($this->handle, $offset, $whence);
+ // this wrapper needs to return "true" for success.
+ // the fseek call itself returns 0 on succeess
+ return !fseek($this->handle, $offset, $whence);
}