feat: Adding a KPM monitor to handle KPM file creation and deletion events

This commit is contained in:
ShirkNeko
2025-04-07 21:18:14 +08:00
parent 1b700fb8e0
commit de089b7b73
3 changed files with 67 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ use std::path::Path;
pub fn on_post_data_fs() -> Result<()> {
ksucalls::report_post_fs_data();
kpm::start_kpm_watcher()?;
utils::umask(0);
#[cfg(unix)]
@@ -98,6 +100,13 @@ pub fn on_post_data_fs() -> Result<()> {
run_stage("post-mount", true);
for entry in std::fs::read_dir(kpm::KPM_DIR)? {
let path = entry?.path();
if path.extension().map_or(false, |ext| ext == "kpm") {
let _ = kpm::load_kpm(&path);
}
}
Ok(())
}