diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/SimpleFS/SimpleFile.php | 11 | ||||
-rw-r--r-- | lib/public/Files/SimpleFS/ISimpleFile.php | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/private/Files/SimpleFS/SimpleFile.php b/lib/private/Files/SimpleFS/SimpleFile.php index e9bf0213d07..52b7819694c 100644 --- a/lib/private/Files/SimpleFS/SimpleFile.php +++ b/lib/private/Files/SimpleFS/SimpleFile.php @@ -146,4 +146,15 @@ class SimpleFile implements ISimpleFile { public function getMimeType() { return $this->file->getMimeType(); } + + /** + * Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen + * + * @return resource + * @throws \OCP\Files\NotPermittedException + * @since 14.0.0 + */ + public function fopen(string $mode) { + return $this->file->fopen($mode); + } } diff --git a/lib/public/Files/SimpleFS/ISimpleFile.php b/lib/public/Files/SimpleFS/ISimpleFile.php index cd092056cda..c417db6354d 100644 --- a/lib/public/Files/SimpleFS/ISimpleFile.php +++ b/lib/public/Files/SimpleFS/ISimpleFile.php @@ -99,4 +99,13 @@ interface ISimpleFile { * @since 11.0.0 */ public function getMimeType(); + + /** + * Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen + * + * @return resource + * @throws \OCP\Files\NotPermittedException + * @since 14.0.0 + */ + public function fopen(string $mode); } |