Write using a stream.

@param string   $path
@param resource $resource
@param Config   $config

@return mixed false or file metadata
761223
public function writeStream($path, $resource, Config $config)
    {
        return $this->stream($path, $resource, $config, 'write');
    }
747505
public function copy($path, $newpath)
    {
        $resource = $this->read($path);

        return isset($resource['contents'])
            ? (bool)$this->update($newpath, $resource['contents'], new Config()) : false;
    }
824454
public function writeStream($path, $resource, Config $config)
    {
        $options = $this->prepareUploadConfig($config);

        return $this->client->upload(
            $this->getBucket(),
            $path,
            stream_get_contents($resource, -1, 0),
            $options
        );
    }
1283478
public static function fileConfig($resource)
    {
        self::$config = new Config($resource, new ConfigLoader());
        self::$config->load();
        self::$config->configure();
    }
494118
public function putStream(string $path, $resource, array $config = []): bool
    {
        $path = $this->normalizePath($path);
        $config = $this->prepareConfig($config);
        $this->rewindStream($resource);

        if (! $this->exists($path)) {
            return $this->getAdapter()->updateStream($path, $resource, $config);
        }

        return $this->getAdapter()->writeStream($path, $resource, $config);
    }
609819
public function updateStream($path, $resource, Config $config)
    {
        return $this->getAdapter()->updateStream($path, $resource, $config);
    }
234418
public function write($path, $contents, Config $config)
    {
        $location = $this->applyPathPrefix($path);
        $options = $this->getOptionsFromConfig($config);
        return $this->ossClient->putObject($this->bucket, $location, $contents, $options);
    }
67557
public function writeStream($path, $resource, Config $config)
    {
        $location = $this->applyPathPrefix($path);
        $result = $this->write($location, stream_get_contents($resource), $config);
        if (is_resource($resource)) {
            fclose($resource);
        }
        return $result;
    }
421502
public function phpConfigFile($path, array $config = [], $namespace = null)
    {
        $this->file($path)->text(Php\ConfigGenerator::generateText($config, $namespace));
    }
529434
protected function _write($path, $content)
    {
        $File = new File($path);
        $File->write($content);
        $File->exists();
    }
594773
public function put(string $path, string $contents, array $config = []): bool
    {
        $path = $this->normalizePath($path);
        $config = $this->prepareConfig($config);

        if (! $this->exists($path)) {
            return $this->getAdapter()->update($path, $contents, $config);
        }

        return $this->getAdapter()->write($path, $contents, $config);
    }
798152
def write(self, path=None):
        
        if not self._path and not path:
            raise ConfigException('no config path given')
        if path:
            self._path = path
        if '~' in self._path:
            self._path = os.path.expanduser(self._path)
        f = open(self._path, 'w')
        f.write(json.dumps(self._data))
        f.close()
1154246
public function update($path, $contents, array $config = []) {
        return $this->getFileSystem()->update($path, $contents, $config);
    }
739050
public function writeStream($uri, $resource, array $config = [])
    {
        return $this->mount_manager->writeStream($uri, $resource, $config);
    }
667976
public function write($path, $contents, Config $config)
    {
        $this->recursiveCreateDir(Util::dirname($path));

        $location = $this->applyPathPrefix($path);
        $stream = $this->share->write($location);

        fwrite($stream, $contents);

        if (!fclose($stream)) {
            return false;
        }

        return compact('path', 'contents');
    }
1337041
public function update($path, $contents, Config $config)
    {
        return $this->upload($path, $contents, $config);
    }
382486
public function updateStream($path, $resource, Config $config)
    {
        return $this->upload($path, $resource, $config);
    }