Top "Flock" questions

Shell: The `flock` utility manages locks in scripts; C programming: flock() applies or removes an advisory lock on an open file.

What is the best way to ensure only one instance of a Bash script is running?

What is the simplest/best way to ensure only one instance of a given script is running - assuming it's …

linux bash pid flock lockfile
Linux flock, how to "just" lock a file?

In Bash, I'm trying to make a function getLock to be used with different lock names. function getLock { getLock_FILE="${1}" …

linux file-locking flock filelock
flock(): removing locked file without race condition?

I'm using flock() for inter-process named mutexes (i.e. some process can decide to hold a lock on "some_name", …

c flock
bash flock: Why 200?

Regarding that thread: bash flock: exit if can't acquire lock I'll appreciate if someone can explain to me what does …

bash flock
python lockf and flock behaviour

I have read enough posts on stackoverflow regarding the difference b/w flock/lockf/fcntl but I am unable to …

python file-locking flock fcntl
Test if file is locked

In PHP, how can I test if a file has already been locked with flock? For example, if another running …

php file-locking flock
bash flock: exit if can't acquire lock

The following lock mechanism is used for preventing a cron job from running concurrently: #!/bin/bash echo "Before critical section" ( …

bash concurrency flock
multiple threads able to get flock at the same time

I was under the impression that flock(2) is thread safe, I recently, ran across the case in the code, where …

c linux glibc flock
Using AppleScript to grab the URL from the frontmost window in web browsers: The definitive list

I built a [widget][1] that grabs the URL from the frontmost window in Safari, then allows you to shorten it …

firefox safari applescript flock camino
flock(): is it possible to merely check if the file is already locked, without actually acquiring the lock if not?

My use case is as follows: I have a program that enforces that only one instance of it can be …

c locking flock