pub fn move_directory_contents(
    src_dir: impl AsRef<Path>,
    dst_dir: impl AsRef<Path>
) -> Result<(), Error>
Expand description

Moves all contents of a directory into another directory, leaving src_dir empty.

Examples:

use libherokubuildpack::move_directory_contents;
use std::path::PathBuf;

move_directory_contents(PathBuf::from("foo"), PathBuf::from("bar")).unwrap();

Errors:

This function will return an error in the following situations, but is not limited to just these cases:

  • src_dir does not exist.
  • dst_dir does not exist.
  • The user lacks the permission to move any of the files in src_dir
  • The user lacks the permission to write files to dst_dir

Atomicity:

This functions makes no atomicity guarantees. It is possible that this function errors after some files already have been moved, leaving src_dir and dst_dir in an inconsistent state.