diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6359608..b639a36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ name: loopdev-3 ci on: push: pull_request: + workflow_dispatch: jobs: check: diff --git a/src/lib.rs b/src/lib.rs index a9abcd0..6d5a0a3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -292,6 +292,13 @@ impl LoopDevice { std::fs::read_link(&p).ok() } + // Get the path of the loop device preserving the error stack. + pub fn path_result(&self) -> Result { + let mut p = PathBuf::from("/proc/self/fd"); + p.push(self.device.as_raw_fd().to_string()); + std::fs::read_link(&p) + } + /// Get the device major number /// /// # Errors