Skip to content
stratis-storagePublic
forked from mdaffin/loopdev

About

A rust library to setup and control loopback devices

Resources

Stars

1 star

Watchers

1 watching

Forks

 
 

Repository files navigation

loopdev

Setup and control loop devices.

Provides rust interface with similar functionality to the Linux utility losetup.

Examples

use loopdev::LoopControl;
let lc = LoopControl::open().unwrap();
let ld = lc.next_free().unwrap();

println!("{}", ld.path().unwrap().display());

ld.attach_file("disk.img").unwrap();
// ...
ld.detach().unwrap();

Development

Running The Tests Locally

Unfortunately the tests require root only syscalls and thus must be run as root. There is little point in mocking out these syscalls as I want to test they actually function as expected and if they were to be mocked out then the tests would not really be testing anything useful.

About

A rust library to setup and control loopback devices

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages