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
5
votes
4 answers

How can my Linux daemon know when a Windows program has stopped writing a file that I access through SAMBA?

I'm developing a system that interfaces with a USPS shipping package called Dazzle. Part of this system includes a monitoring daemon whose purpose is to take tab-separated value files, turn them into XML that Dazzle recognizes, and pass them to…
Aurelia Peters
  • 2,169
  • 1
  • 20
  • 34
5
votes
1 answer

Does FileChannel tryLock() method checks for locks or just breaks them?

I have two processes that may access the same file concurently and wanted to implement file locking. The trouble seems to be that one process is written in java and the other in C and it is not clear how low level locking is implemented on java…
homerski
  • 51
  • 3
5
votes
5 answers

c# Image from file close connection

I display an image using c# in a pictureBox. Then I want to change the image's name. I can't because I get that the image is being used by another process. I open the image this way Image image1 = Image.FromFile("IMAGE LOCATION"); ; …
RonaDona
  • 912
  • 6
  • 13
  • 30
4
votes
2 answers

C# accessing locked files

I want to access a file via c# which is created and still processed via a different program. Currently I am copying the file via the Windows explorer to a different location and work then with the copy. As the copy is large I would prefer to work…
weismat
  • 7,195
  • 3
  • 43
  • 58
4
votes
0 answers

DLL is still locked after calling FreeLibrary

My architecture is as follows: Program.exe links to 1.dll 1.dll attempts to load DLL files in some directory (i.e. 2.dll) via LoadLibrary 1.dll attempts to find a function called "setup" via GetProcAddress("setup") 1.dll does some work and may…
user_4685247
  • 2,878
  • 2
  • 17
  • 43
4
votes
3 answers

File lock not working as expected

I have a Thread-extending class that is supposed to run only one instance at a time (cross-process). In order to achieve that, I'm trying to use a file lock. Here are bits of my code: class Scanner(Thread): def __init__(self, path): …
Felix
  • 88,392
  • 43
  • 149
  • 167
4
votes
2 answers

Check if file is locked by a process filehandle

Given I have a list of all file handles of all processes, how could I find out which of these handles are actually locking a file? From what I understand I could simply try to open the files and try to get all the permissions and if something goes…
Forivin
  • 14,780
  • 27
  • 106
  • 199
4
votes
1 answer

Getting notified when a file lock is released

[Using C# and Windows as platform] I have a camera that writes JPG files to a local folder in my PC. I want to load each file the camera drops, so I have a FileSystemWatcher that notifies me whenever a new picture is created, but the camera locks…
SuperJMN
  • 13,110
  • 16
  • 86
  • 185
4
votes
2 answers

python filelock module deleting files

I have downloaded the filelock module in order to lock files using my python program. this is my code: import filelock lock = filelock.FileLock(path) lock.acquire() #do something... lock.release() for some reason I don't understand when I release…
Isdj
  • 1,835
  • 1
  • 18
  • 36
4
votes
2 answers

Visual Studio 2010 Designer Bug: Unable to copy from obj\debug to bin\debug

Wondering if anyone has a solution to this 2010 bug. I have a project that built fine in Visual Studio 2008 that wont build in 2010 because Visual Studio is holding on to the dll after the application is run ONLY if a designer window is open. I…
Jeff Lundstrom
  • 1,043
  • 1
  • 8
  • 22
4
votes
1 answer

Move a file without releasing lock

I am using Java NIO in spring batch application. The application looks in a directory (e.g. /shared/inbox) where /shared is network shared disk among all instances of applications running on different JVMs. To avoid multiple threads reading same…
4
votes
3 answers

Cannot delete an image file that is shown in a listview

In my listview I show thumbnails of small images in a certain folder. I setup the listview as follows: var imageList = new ImageList(); foreach (var fileInfo in dir.GetFiles()) { try { var image = Image.FromFile(fileInfo.FullName); …
Enrico
  • 1,937
  • 3
  • 27
  • 40
4
votes
3 answers

Process Synchronization in java

Process A writes in a file XYZ, when executed. There are processes B and C, which when executed, reads the file XYZ. So, while process A is up, B and C should wait for A to complete. To provide synchronization can I use java.nio package? or I should…
4
votes
2 answers

.NET isolated storage file locking throws NRE

So I am trying to lock an isolated storage file in my C# client application, so that multiple copies of my application are not able to access it at the same time. I am using the following syntax: lockStream = new IsolatedStorageFileStream("my.lck",…
bsiegel
  • 237
  • 1
  • 9
4
votes
1 answer

How does Windows remove locked files in the next reboot when you uninstall a program?

How does Windows remove locked files in the next reboot when you uninstall a program? Maybe with some kind of scheduled process?
fernando1979
  • 1,727
  • 2
  • 20
  • 26
1 2
3
12 13