Questions tagged [filelock]

File locks are locks held by an application, preventing interference from other processes. Locks may be advisory (may be ignored by others), or mandatory, enforced by the operating system, depending on implementation.

File locks are locks held by an application, preventing interference from other processes. Locks may be advisory (may be ignored by others), or mandatory, enforced by the operating system, depending on implementation.

190 questions
0
votes
1 answer

Programmatic way to get open files info similar to Computer Management\Shared Folders\Open Files? (Server 2012R2)

Trying to track open files\locks on a server due to application issues. I can use Computer Management\Shared Folders\Open Files and see this data. The fields I get are: Open File, Accessed By, Type, # Locks, Open Mode Using this tool, I can export…
0
votes
1 answer

Getting OverlappingFileLockException when locking file channel in Java

Here's the part of the code that is problematic: FileChannel fileChannel = FileChannel.open(filePath, StandardOpenOption.WRITE); fileChannel.force(true); FileLock lock =…
A6SE
  • 177
  • 1
  • 11
0
votes
1 answer

Powershell File Lock function is not opening excel File

I've written a function to check if an excel file is being used/locked by another process/user in a shared network drive, and if used, to pause the script and keep checking till it's available as the next action is to move it out of it's folder.…
0
votes
0 answers

Release shared memory semaphore when process killed

I have short python script that is supposed to: be used by many users and threads concurrently, call another program (/usr/bin/ld) call this other program not more than x times concurrently (e.g. 2 concurrent calls to ld) handle being interrupted /…
MateuszL
  • 2,751
  • 25
  • 38
0
votes
2 answers

Opening new process in Java and keeping current one open

Got a task to make new version of our software to new client, and I need to make application behave so, that originally started application starts another and stays open at the back. At the moment original one is closed when new starts. Original…
0
votes
4 answers

Why one JVM get FileLock twice will throw OverlappingFileLockException?

Why get the FileLock twice in one JVM will throw OverlappingFileLockException? Why couldn't the second lock aquirement be blocked and get the lock when it released?
Hesey
  • 4,957
  • 6
  • 31
  • 31
0
votes
1 answer

Python 2.7: Call to subprocess.popen blocks file access

I am trying to develop a simple function that opens a file, starts a sub-process, then closes the file, then moves the file to a different location and then stops the sub-process. What happens is that I am unable to move the file as long as…
0
votes
1 answer

Lock file/"folder" to a specific JVM and iterate if locked

I'm using multiple JVMs, but I need that each JVM to use a specific folder. What I'm trying to do is iterate through folders till it finds a file that is not locked and then lock it to use that specific folder. Here I'm filtering the folders I want…
0
votes
1 answer

ObjectInputStream throws ioexception inside the filelock lock section

I have a function, that has to put key value pair into map stored in file. If file does not exist, I have to create it. I try to lock the file, when I work with it with Filelock lock(). But when I try to write into it( Inside of the locked section),…
neverEugene
  • 69
  • 10
0
votes
1 answer

FileLock to prevent deletion of a file but I can't open it

I'm using a FileLock to prevent the deletion of a .zip file but I can't open it. So I'm trying to find something to block the file but be able to open it. There is my code : File file = new File(myfile); FileInputStream in = new…
0
votes
0 answers

Extend filelock even the program is not running

Im having trouble with the files that I want to lock permanently. My program can lock the files but when I exit the program (the program is not running) the lock will be release. I want to lock files even the program is not running, is it possible?…
SteveLamb
  • 1
  • 1
0
votes
2 answers

python 2.7 file overwritten even after using "a" (threads and filelock used)

I've a loop generating threads every 5 seconds and each thread is trying to append same file using filelock module in python but looks like they end up over-writing the file import threading import filelock def loop(): …
ubanthia
  • 5
  • 2
0
votes
2 answers

Load and dump to file in multithreading using Pickle and filelock - IOError: [Errno 13]

I have a service that load and dump data from a python dict into a file using python 2.7 cPickle. This service can be called simultaneously by many users. What approach would allow cPickle to read and dump data into a single file in a multithreading…
Below the Radar
  • 7,321
  • 11
  • 63
  • 142
0
votes
2 answers

c++ - mutex or flock fcntl.h to lock only write operation

I am trying to append (write append) to a file from different threads (similar to logging) and so there is no inter-process locking needed. I have studied flock in fcntl.h and it says flock can do granular lock along with inter-process which is not…
fury.slay
  • 1,202
  • 1
  • 15
  • 26
0
votes
1 answer

Python filelock module behavior using `with:` statement

I was just wondering about the specifics of python's module filelock and its behavior in a few circumstances. First, how exactly is the with: statement handled by threads. If multiple threads call with: is it locked on a thread by thread basis? Is…
Ryan Schaefer
  • 3,047
  • 1
  • 26
  • 46