protected function openFileObject($mode, $skipEmptyLines)
    {
        if (!$this->getParent()->isDir()) {
            $this->getParent()->mkdirs();
        }

        $newFile = false;
        if (!$this->isFile()) {
            switch ($mode)
            {
                case 'w':
                case 'w+':
                case 'a':
                case 'a+':
                case 'x':
                case 'x+':
                    $newFile = true;
                    break;
            }
        }

        $this->fileObject = $this->openFile($mode);

        if ($skipEmptyLines) {
            $this->skipEmptyLines = true;
            $this->fileObject->setFlags(\SplFileObject::DROP_NEW_LINE | \SplFileObject::READ_AHEAD| \SplFileObject::SKIP_EMPTY);
        } else {
            $this->fileObject->setFlags(\SplFileObject::DROP_NEW_LINE);
        }

        if ($newFile) {
            $this->chmod($this->defaul_permission);
        }
    }