Implement the File stream interface

This commit is contained in:
Robin Appelman 2014-08-03 16:13:02 +02:00
commit dbc6aa4a9e
3 changed files with 23 additions and 3 deletions

View file

@ -7,7 +7,9 @@
namespace Icewind\SMB;
class NativeStream {
use Icewind\Streams\File;
class NativeStream implements File {
/**
* @var resource
*/
@ -55,7 +57,7 @@ class NativeStream {
}
public function stream_open() {
public function stream_open($path, $mode, $options, &$opened_path) {
$context = stream_context_get_options($this->context);
$this->state = $context['nativesmb']['state'];
$this->handle = $context['nativesmb']['handle'];
@ -85,4 +87,12 @@ class NativeStream {
public function stream_truncate($size) {
return $this->state->ftruncate($this->handle, $size);
}
public function stream_set_option($option, $arg1, $arg2) {
return false;
}
public function stream_lock($operation) {
return false;
}
}