A rust library to setup and control loopback devices
Find a file
Michael Daffin 4cf1ce4ec7 Refactors losetup
It is now easier to read and follow making it a better example.

Attach now accepts a quite flag and by default prints out the loop device that was attached.
History 2017-12-20 16:11:54 +00:00
losetup Refactors losetup 2017-12-20 16:11:54 +00:00
src Fixes losetup and renames size to sizelimit 2017-12-19 13:11:56 +00:00
.gitignore Changes the global statics to consts 2017-12-05 10:23:17 +00:00
.travis.yml Removes doc building and adds building losetup to travis 2017-12-05 13:59:27 +00:00
Cargo.toml Splits out the attach method into three convinence function 2017-12-19 12:52:46 +00:00
LICENSE Adds some needed files 2016-05-20 23:33:08 +01:00
README.md Fixes losetup and renames size to sizelimit 2017-12-19 13:11:56 +00:00

Build Status crates.io

loopdev

Setup and control loop devices.

Provides rust interface with similar functionalty to the linux utility losetup.

Documentation

Examples

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

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

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