MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / set_rootfs_image_file_mode

Function set_rootfs_image_file_mode

crates/openshell-driver-vm/src/rootfs.rs:185–198  ·  view source on GitHub ↗
(
    image_path: &Path,
    guest_path: &str,
    mode: u32,
)

Source from the content-addressed store, hash-verified

183}
184
185pub fn set_rootfs_image_file_mode(
186 image_path: &Path,
187 guest_path: &str,
188 mode: u32,
189) -> Result<(), String> {
190 let regular_file_mode = 0o100_000 | (mode & 0o7777);
191 let Some(quoted_guest_path) = debugfs_quote_absolute_path(guest_path) else {
192 return Err(format!("invalid debugfs guest path '{guest_path}'"));
193 };
194 run_debugfs(
195 image_path,
196 &format!("set_inode_field {quoted_guest_path} mode 0{regular_file_mode:o}"),
197 )
198}
199
200#[cfg(target_os = "macos")]
201fn try_clone_file(source: &Path, dest: &Path) -> Result<(), String> {

Callers 4

Calls 2

run_debugfsFunction · 0.85

Tested by

no test coverage detected