/** * Initializes a new instance of that class. * * @param string $path The path of the file. * @param string $mode The mode * * @throws IOException File could not be opened. */ public function __construct($path, $mode = 'r+') { $path = ClrString::asString($path); $res = \fopen((string) $path, ClrString::valueToString($mode, false)); if (false === $res) { $this->throwIOException('Could not open file!'); } $this->_file = $path; parent::__construct($res, true); }