Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-12-18 18:40:43 +0400
committerBjoern Schiessle <schiessle@owncloud.com>2014-02-27 21:01:51 +0400
commit8b3d99308c3be77e5c042ab7f64de53fa79adf50 (patch)
tree090fc54faa7343820d091d388f6b1899ad98a35b /apps/files_encryption
parentf87319f834aa3858ac338cc400a310b23ff0e903 (diff)
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);
}