All Projects → gofrs → Flock

gofrs / Flock

Licence: bsd-3-clause
Thread-safe file locking library in Go (originally github.com/theckman/go-flock)

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Flock

logging
Generic file logger for .NET Core (FileLoggerProvider) with minimal dependencies
Stars: ✭ 109 (-62.15%)
Mutual labels:  file
Imessage
💬 Send iMessages from command-line
Stars: ✭ 261 (-9.37%)
Mutual labels:  osx
Footswitch
Command-line utility for PCsensor foot switch
Stars: ✭ 282 (-2.08%)
Mutual labels:  osx
Lazer Database
PHP flat file database to store data with JSON
Stars: ✭ 254 (-11.81%)
Mutual labels:  file
Vimmode.spoon
Adds vim keybindings to all OS X inputs
Stars: ✭ 262 (-9.03%)
Mutual labels:  osx
Chronos Timetracker
Desktop client for JIRA. Track time, upload worklogs without a hassle.
Stars: ✭ 273 (-5.21%)
Mutual labels:  osx
github-content
Easily download files from github raw user content.
Stars: ✭ 21 (-92.71%)
Mutual labels:  file
Darklightning
Simply the fastest way to transmit data between iOS/tvOS and OSX
Stars: ✭ 286 (-0.69%)
Mutual labels:  osx
12306formac
An unofficial 12306 Client for Mac
Stars: ✭ 2,796 (+870.83%)
Mutual labels:  osx
Mapmap
Open source video mapping software
Stars: ✭ 282 (-2.08%)
Mutual labels:  osx
Naza
🍀 Go basic library. || Go语言基础库
Stars: ✭ 253 (-12.15%)
Mutual labels:  file
Tableexport
tableExport(table导出文件,支持json、csv、txt、xml、word、excel、image、pdf)
Stars: ✭ 261 (-9.37%)
Mutual labels:  file
Vfile
Virtual file format for text processing used in @unifiedjs
Stars: ✭ 278 (-3.47%)
Mutual labels:  file
nodejs-system-sleep
Sleep function for Node.js All platforms.
Stars: ✭ 47 (-83.68%)
Mutual labels:  osx
Dosxvpn
Easily deploy your own personal VPN server with DNS adblocking running on DigitalOcean
Stars: ✭ 284 (-1.39%)
Mutual labels:  osx
omnitty
Omnitty: Multiple-Machine SSH Multiplexer
Stars: ✭ 20 (-93.06%)
Mutual labels:  osx
Ltfinderbuttons
My Finder buttons collection for macOS.
Stars: ✭ 269 (-6.6%)
Mutual labels:  osx
Vmware Usb Osx
Easily create a bootable USB installer for VMware ESXi / vSphere Hypervisor
Stars: ✭ 286 (-0.69%)
Mutual labels:  osx
Passepartout Apple
User-friendly OpenVPN client app for iOS and macOS.
Stars: ✭ 284 (-1.39%)
Mutual labels:  osx
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+1025.35%)
Mutual labels:  osx

flock

TravisCI Build Status GoDoc License Go Report Card

flock implements a thread-safe sync.Locker interface for file locking. It also includes a non-blocking TryLock() function to allow locking without blocking execution.

License

flock is released under the BSD 3-Clause License. See the LICENSE file for more details.

Go Compatibility

This package makes use of the context package that was introduced in Go 1.7. As such, this package has an implicit dependency on Go 1.7+.

Installation

go get -u github.com/gofrs/flock

Usage

import "github.com/gofrs/flock"

fileLock := flock.New("/var/lock/go-lock.lock")

locked, err := fileLock.TryLock()

if err != nil {
	// handle locking error
}

if locked {
	// do work
	fileLock.Unlock()
}

For more detailed usage information take a look at the package API docs on GoDoc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].