apps/files_external/3rdparty/icewind/smb/src/Share.php
/**
	 * Open a readable stream to a remote file
	 *
	 * @param string $source
	 * @return resource a read only stream with the contents of the remote file
	 *
	 * @throws \Icewind\SMB\Exception\NotFoundException
	 * @throws \Icewind\SMB\Exception\InvalidTypeException
	 */
Open a readable stream to a remote file
@param string $source
@return resource a read only stream with the contents of the remote file


Open a readable stream to a remote file @param string $source @return resource a read only stream with the contents of the remote file
public function read($source) {
		$source = $this->escapePath($source);
		$connection = $this->getConnection();
		$connection->write('get ' . $source . ' ' . System::getFD(5));
		$connection->write('exit');
		$fh = $connection->getFileOutputStream();
		stream_context_set_option($fh, 'file', 'connection', $connection);
		return $fh;
	}
public function read ( $ source ) { $ source = $ this -> escapePath ( $ source ) ; $ connection = $ this -> getConnection ( ) ; $ connection -> write ( 'get ' . $ source . ' ' . System :: getFD ( 5 ) ) ; $ connection -> write ( 'exit' ) ; $ fh = $ connection -> getFileOutputStream ( ) ; stream_context_set_option ( $ fh , 'file' , 'connection' , $ connection ) ; return $ fh ; }
Open a readable stream to a remote file
 @param string $source
 @return resource a read only stream with the contents of the remote file
Open a readable stream to a remote file @param string $source @return resource a read only stream with the contents of the remote file
// since returned stream is closed by the caller we need to create a new instance // since we can't re-use the same file descriptor over multiple calls