Skip to content
flock(1) locks files
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
config config: update symlinks Dec 18, 2015
man added long options, -E and —-verbose, changed spaces to tabs, possibl… Sep 15, 2018
src Merge pull request #20 from jayjlawrence/master Oct 19, 2018
t Add testing on -c omission, and locality Nov 30, 2016
.gitignore .gitignore: sort & cleanup Dec 18, 2015 update copyright Dec 18, 2015 remove unused-result warning to support Centos 6.7 sourc… Dec 18, 2015 initial commit Aug 17, 2014, bump version to 0.2.3 Dec 18, 2015


flock(1) locks files

The simplest thing that could possibly work

To exclusively lock /tmp/my.lock while running the utility echo "hello, world!":

flock /tmp/my.lock echo "hello, world!"


Mac OS X Homebrew:

brew tap discoteq/discoteq
brew install flock

From source:

xz -dc flock-${FLOCK_VERSION}.tar.xz | tar -x
cd flock-${FLOCK_VERSION}
make install

Wait, isn't there already a flock(1)?

Yep, it's part of util-linux.

What makes discoteq flock(1) different is:

  • Support for latest stable Linux (Debian & CentOS), Illumos (OmniOS & SmartOS), Darwin & FreeBSD
  • Testing for all major features and edge conditions
  • ISC license
  • Public access to source history and bug tracking

Project Principles

  • Community: If a newbie has a bad time, it's a bug.
  • Software: Make it work, then make it right, then make it fast.
  • Technology: If it doesn't do a thing today, we can make it do it tomorrow.


Got an idea? Something smell wrong? Cause you pain? Or lost seconds of your life you'll never get back?

All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.

Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.

It is more important to me that you are able to contribute.

Creating a new issue is probably the fastest way to get something fixed, but feel free to contact me via email (, in IRC or however you can.

There's no wrong way to file a bug report, but I'll be able to help fastest if you can describe:

  • what you did
  • what you expected to happen
  • what actually happened

(Some of the above was repurposed with <3 from logstash)

You can’t perform that action at this time.