subspace-core 0.3.0

Subspace Framework core: config file, credentials, HTTP agent, state and PATH lookup. Internal crate; apps depend on `subspace-framework`.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Serialize separately opened writers and processes with the standard OS lock.

use std::fs::File;
use std::io;
use std::path::Path;

use super::files;

pub(super) fn acquire(live: &Path) -> io::Result<File> {
    let path = files::suffixed(live, ".run-day-v1.lock");
    let file = files::open_private(&path)?;
    file.lock()?;
    Ok(file)
}