flock Questions
2
Solved
I have read php's manual page on the 'file_get_contents' function which does not state anything about how 'file_get_contents` behaves with respect to php's file locking. However in the comment sect...
4
Solved
My use case is as follows: I have a program that enforces that only one instance of it can be running at any given time, so at startup it always tries to grab hold of a lock file in a standard loca...
3
I am having trouble figuring out why flock() is not behaving properly in the following scenario.
The following code is placed into two different PHP scripts one "test1.php" and the other "test2.ph...
3
Solved
I have cron job to run node.js scripts.
Want to use flock to lock a file to make sure my cron jobs are not
overlapped.
Any good module for doing file locking ?
Or I should call that in child pro...
2
Solved
In C programming, is there a way to achieve timeout on flock()?
Thanks.
#include <sys/file.h>
int flock(int fd, int operation);
2
Will flock or lockf work on a directory?
I there another way to lock a directory in C on a linux machine?
3
I wrote a simple go application and added a flock system to prevent being running twice at the same time:
import "github.com/nightlyone/lockfile"
lock, err := lockfile.New(filepath.Join(os.TempDi...
3
Solved
In PHP, how can I test if a file has already been locked with flock? For example, if another running script has called the following:
$fp = fopen('thefile.txt', 'w');
flock($fp, LOCK_EX);
Watters asked 25/12, 2013 at 10:37
4
Solved
Greetings all. I'm setting up a cron job to execute a bash script, and I'm worried that the next one may start before the previous one ends. A little googling reveals that a popular way to address ...
Insomnolence asked 26/12, 2009 at 20:35
2
Solved
I am using bash and flock on centos.
Normally I would run cd /to/my/dir && python3.6 runcommand.py
But then we add it to cron and don't want output so add > /dev/null 2>&1
And...
8
Is there a flock command on Mac OS X that manages file lock?
http://linux.die.net/man/1/flock
Bartram asked 10/5, 2012 at 2:10
1
7
Solved
PHP's documentation page for flock() indicates that it's not safe to use under IIS. If I can't rely on flock under all circumstances, is there another way I could safely achieve the same thing?
4
What ways are there available, for exclusively opening a device file (say, the display frame buffer)?
[Info: I already know about flock() & friends, which have an effect only when the other app...
4
context
I'm slowly writing a specialized web server application in C++ (using the C onion http server library and the JSONCPP library for JSON serialization, if that matters)., for a Linux system ...
3
Solved
I'm studing the flock mecanism in PHP and I'm having a hard time understanding the functionality of the LOCK_SH mode. I read on a site that it locks the file so that other scripts cannot WRITE in i...
3
Solved
I'm using flock() for inter-process named mutexes (i.e. some process can decide to hold a lock on "some_name", which is implemented by locking a file named "some_name" in a temp directory:
lockfil...
3
Solved
Scenario: I have many processes running that need to fetch files over the net. If the file is already downloaded, I want it cached on disk. If another process is downloading the file, block until i...
4
Solved
I have a website where at the same moment, there can be multiple users writing to the same file at the same time. An example of my code is below.
PHP 5.6.20
<?php
$root=realpath($_SERVER["DOCU...
1
Solved
flock() is PHP's portable advisory file locking function. They explicitly promote that it even works under windows:
flock() allows you to perform a simple reader/writer model which can be used o...
14
Solved
What is the simplest/best way to ensure only one instance of a given script is running - assuming it's Bash on Linux?
At the moment I'm doing:
ps -C script.name.sh > /dev/null 2>&...
1
Solved
I want to get output from two processes and merge them into one file, like:
proc1 >> output &
proc2 >> output &
The problem is that output may be mixed up in the final file.
Fo...
Aerify asked 21/8, 2016 at 6:59
1
I have read enough posts on stackoverflow regarding the difference between flock/lockf/fcntl but I am unable to answer the below observation:
>>> import fcntl
>>> a = open('/tmp/l...
Eulaeulachon asked 12/2, 2015 at 5:50
2
Flock is a reasonably new iOS app from the guys at Bump, which has an interesting feature. It somehow knows when photos have been taken by another app, notifies the user (in a notification center w...
Complete asked 10/1, 2013 at 23:14
3
Solved
I need to run a python script (job.py) every minute. This script must not be started if it is already running. Its execution time can be between 10 seconds and several hours.
So I put into my cron...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.