Skip to main content

install_lib_tree

Function install_lib_tree 

Source
pub fn install_lib_tree(
    archive_path: &Path,
    lib_dir: &Path,
    lib_name: &str,
) -> Result<PathBuf, ExtractError>
Expand description

Install a Lua library tree from archive_path into <lib_dir>/<lib_name>/, replacing any existing tree at that path.

Strategy: extract into a sibling staging directory .<name>.new, then swap (rm -rf <name> if present, mv <name>.new <name>). The swap window is small but not strictly atomic for non-empty target directories — POSIX rename only clobbers empty directories.