public function writeDirectory()
    {
        $toDirectory = dirname($this->path);

        if (!file_exists($toDirectory)) {
            mkdir($toDirectory, 0770, true);
        }

        if (!is_dir($toDirectory)) {
            throw new Concentrate_FileException(
                "Could not write to directory {$toDirectory} because it " .
                "exists and is not a directory.",
                0,
                $toDirectory
            );
        }

        return $this;
    }