Skip to main content

add_file_util

Function add_file_util 

Source
pub fn add_file_util(lua: &Lua, quiet: bool) -> Result<(), Error>
Expand description

Exposes filesystem and staging utilities to the Lua environment.

This module provides the “Staging Engine” for Zoi packages. Key functions include:

  • zcp: Stages files and directories into the STAGING_DIR using origin-aware placeholders.
  • zln: Records symbolic link creation to be performed during the final installation.
  • zmkdir: Records directory creation.
  • zchmod/zchown: Records metadata changes for staged files.

These functions do not always perform immediate actions; instead, they often record operations into __ZoiBuildOperations for the Rust engine to execute atomically during the staging-to-store move.