public function getFileObject($file, $mode = 'r')
    {
        $filepath = $this->dir . $file;
        //check the filepath exists. It may have been created,
        //modified or deleted outside of Temping.
        if (!file_exists($filepath) || !is_writable($filepath)) {
            throw new \Exception("File not found: '$file'");
        }

        return new SplFileObject($filepath, $mode);
    }