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

Having trouble releasing a Java FileLock

I haven't worked with nio much and I'm having some trouble with releasing a FileLock. Basically, in JVM-A I have a NON-SHARABLE write lock on a file which looks something like this: File lockfile = new File("m.lock"); RandomAccessFile writeFile =…
Michael Remijan
  • 687
  • 7
  • 22
0
votes
0 answers

Event based on Windows file locked error

I am trying to work out how I can create a dotnet event that fires when somebody tries to access a file shared on my computer that is locked (as shown in compmgmt.msc). Does anybody know how I can achieve this?
Jamesla
  • 1,378
  • 7
  • 31
  • 62
0
votes
1 answer

Will shell script lock a file while writing content?

I have a shell script, That writes a content in to the file, #!/bin/bash SLEEP=1 FILE_PATH=${1} while true do ps aux wc -l > ${FILE_PATH} sleep ${SLEEP} done I have another PHP Script that reads the content of the file using…
0
votes
1 answer

Can't read or write from a locked file in Java

I've locked a file using a FileLock in Java, but now I can't read to or write from it. What do I do?
Dylan Knowles
  • 2,726
  • 1
  • 26
  • 52
0
votes
2 answers

C# text file sharing scheme for multiple users

Instead of me writing from scratch a text file sharing windows form application, I thought I would simply ask if someone has a snippet (C#) or methodology that I could use? The application merely needs to create a text file and allow multiple users…
dellbingham
  • 59
  • 1
  • 5
0
votes
1 answer

How to lock, text file open for reading?

I want lock my input text file, in my program, so if the next occurrence of program is run on the same file it crash (throws exception). I know that i can lock file with "java.nio.channels.FileLock" but it's possible only if file is open for…
Matteo Codogno
  • 1,569
  • 6
  • 21
  • 36
-1
votes
0 answers

Python: Lock a directory

I have a python script which gets executed via cron every 5 minutes. This script operates on a directory. Sometimes it takes longer then 5 minutes and I want to avoid that two jobs run in parallel. I tried to use the library flockcontext but this…
guettli
  • 25,042
  • 81
  • 346
  • 663
-1
votes
1 answer

cannot save file because it's in use

I've tried so many different ways to do this, and it's still telling me the file is in use when I try to delete it before saving it again. if (Clipboard.GetDataObject().GetData(DataFormats.Bitmap) != null) { if (File.Exists(filename)) {…
Starfleet Security
  • 1,813
  • 3
  • 25
  • 31
-1
votes
1 answer

Acquring read/write lock in Java using FileLock

I'm working on a program in Java where a read/write lock is required. The scenario is multiple processes can write to the file at the same time. I have used the following line to lock the File. FileOutputStream fos = new…
Sri
  • 573
  • 2
  • 6
  • 20
-3
votes
1 answer

"pip install tox" giving Found existing installation: filelock 2.0.12

I am getting following output. enter image description here
Junaid Nz
  • 1
  • 1
1 2 3
12
13