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
2
votes
2 answers

Concurrently write to XML file

I have multiple processes running on different machines which are required to read/write to a shared XML file, for this I am using DOM with Java and FileLocks (While I know that a database would be a more effective approach, this is not viable due…
Hungry
  • 1,645
  • 1
  • 16
  • 26
2
votes
0 answers

Read/write to XML file simultaneously in a Filelock using JAXB

I have an XML file (in question) is used by process across multiple JVM. At one point of time, multiple process access the same file and writes to it. And i want the updated information to be read after each write. So basically 'FileLock' is a way…
ulab
  • 1,079
  • 3
  • 15
  • 45
2
votes
1 answer

How to access the Windows global file lock table in .Net?

Is there a way, through .Net or by dropping to the Win32 API in .Net, to access the Windows global file lock table? I'm looking for a better solution to determining if a group of files are locked other than checking each individual file to see if a…
user32826
2
votes
1 answer

C# Avoid file lock when Assembly.Load

My situation is; I am designing a plugin application, based on dynamically loading plugin assemblies more than one user may run the application that's hosted on a server machine. Application is auto-updating plugin assemblies from my live update…
Ender KARADAG
  • 87
  • 2
  • 11
2
votes
2 answers

Why are Twisted's DeferredFilesystemLocks not safe for concurrent use?

In the Twisted API for DeferredFilesystemLock, it is stated that deferUntilLocked is not safe for concurrent use. I would like to understand in what way it is unsafe and what makes it unsafe, in order to ensure that I don't misuse the file locks.
Corey
  • 1,845
  • 1
  • 12
  • 23
2
votes
5 answers

C# - Lock file until browser is closed, user navigates away from page, or session expires

Is there any way to lock a file until a browser is closed, the user leaves the current page, or their session expires? I have a java app that reads annotations from a text file and lets a user modify or add more annotations to a pdf through the java…
Zach
  • 63
  • 7
2
votes
2 answers

Read external log file without creating file-lock

Trying to read a log file line-by-line (in Java). This log file is being written to simultaneously by another process (non-java program). I have 2 approaches - BufferedReader (BufferedReader br = new BufferedReader(new…
Quest Monger
  • 8,252
  • 11
  • 37
  • 43
2
votes
0 answers

Will JAXB handle file locking for me?

I would like to make sure that no other process modifies the xml file while reading it. This is my code: final File file = new File(configFilePath); final FileChannel channel = new RandomAccessFile(file, "rw").getChannel(); final FileLock lock =…
sprehn
  • 53
  • 4
2
votes
1 answer

deleting image files locked by vshost.exe c#

I have a c# application which shows images in a form. I'm trying to overwrite these images and regenerate them. I get an exception while I'm trying to delete an existing image (it's a png in this case). I tried disposing the image that the…
Gary
  • 495
  • 3
  • 11
  • 21
1
vote
2 answers

Why is the SMTP service locking the files for several hours?

We are currently using the SMTP service in IIS 6.0 to send mails. All incoming relay mails are monitored by another service which processes the relay mail and deletes/moves it. It works fine! We have then installed a certificate to be able to enable…
Kim Rasmussen
  • 453
  • 1
  • 8
  • 21
1
vote
0 answers

fcntl record lock works in multithreads?

I test multiprocess record lock with fcntl function, my current request needs to use record lock between threads. I tested it, but it doesnot work as thought, do you have any suggestion on multithreads record locking?
StevenWang
  • 3,625
  • 4
  • 30
  • 40
1
vote
1 answer

How to check/change a general file's status as being read?

There is a folder which contains many files in it. The users of my application will work in this folder simultaneously. This application uses Path.rglob() to loop over the files in the folder. I would like to develop a mechanism that when a file is…
Lion Lai
  • 1,862
  • 2
  • 20
  • 41
1
vote
2 answers

Assembly is being used by another process

I've upgraded a WCF project running 3.5 vs2008 to .net 4.0 vs2010 and run into a problem. When compiling from vs2010 an assembly in my service implementation project is locked by devenv.exe (note no debugging - only compiling). The assembly is…
jaspernygaard
  • 3,098
  • 5
  • 35
  • 52
1
vote
1 answer

Can i use file locking in this scenario?

Please i have a conceptual question. I have two processes that outputs a file with the same name in the same directory and then execute/read that file in a perl script. These two processes can be run concurrently and i am afraid there is a chance…
Lance
  • 23
  • 5
1
vote
1 answer

Exclusive lock on file is downgraded, when another FileChannnel for the locked file is closed

I acquire exclusive FileLock for the file, but when I create another RandomAccessFile/FileChannel for the file and close it then the FileLock is downgraded and I can acquire FileLock for the file from another process. Following reproducible test…
HPCS
  • 1,434
  • 13
  • 22