Function file_lock_nonblocking

Source
pub fn file_lock_nonblocking<P: AsRef<Path>>(
    path: P,
    exclusive: bool,
) -> Result<FileLock, FileLockError>
Expand description

Try to get an flock based lock on a lock file, give an FileLockError::AlreadyLocked error if can’t get it. The file is created or truncated.