file-storage 0.8.0

This library aids in accessing file-like storage.
Documentation
use crate::{Error, FilePath};

impl FilePath {
    //! Write Empty

    /// Writes an empty file.
    ///
    /// Returns `Ok(())`.
    /// Returns `Err(FileAlreadyExists)` if the file already exists.
    pub fn write_empty(&self) -> Result<(), Error> {
        self.write_data(b"")
    }

    /// Writes an empty file if the file does not exist.
    ///
    /// Returns `Ok(true)` if the file was written.
    /// Returns `Ok(false)` if the file already exists.
    pub fn write_empty_if_not_exists(&self) -> Result<bool, Error> {
        self.write_data_if_not_exists(b"")
    }
}