Function file_lock::unlock [] [src]

pub fn unlock(lock: &Lock) -> Result<boolError>

Unlocks the file held by Lock.

In reality, you shouldn't need to call unlock(). As Lock implements the Drop trait, once the Lock reference goes out of scope, unlock() will be called automatically.

Example

extern crate file_lock;

use file_lock::*;

fn main() {
    let l = lock("/tmp/file-lock-test").ok().unwrap();

    if unlock(&l).is_ok() {
        println!("Unlocked!");
    }
}