Linked Questions

5 votes
4 answers
27k views

Possible Duplicate: How can I lock a file using java (if possible) I have two process that invoke two Java programs that modifying the same text file. I notice the content of the text file is ...
Thang Pham's user avatar
  • 38.8k
5 votes
1 answer
5k views

I need to lock a file in unix/linux OS. I have googled and read about java.nio.channels Filelock and Reentrant File Lock . But both works in Windows but not in unix. Is there any other way of ...
user avatar
0 votes
1 answer
4k views

I have two processes reading/writing same files. So I wanna create a lock between them. My idea is to create a file in that folder named file.lock containing the process identification information. ...
NSF's user avatar
  • 2,559
2 votes
2 answers
1k views

Possible Duplicate: How can I lock a file using java (if possible) Is it possible to lock file so that other apps cannot write to file but can still run it normally? My target platform is windows.
randomguy's user avatar
-1 votes
1 answer
964 views

In my application multiple processes are trying access a file for read and write. Every application has a single thread. I need to make sure that no 2 processes are accessing the file at the same time....
Bagira's user avatar
  • 2,263
1 vote
1 answer
468 views

I have 2-3 programs which can modify file but I want to block others if one program is using it. I cant use synchronization in this. Is there any other provision ?
Kalrav J Parsana's user avatar
0 votes
1 answer
427 views

I'm writing two programs that communicate through a text file. The first program writes to the file and the second one reads from it. However, there is a problem when the reader program tries to read ...
A6SE's user avatar
  • 177
0 votes
1 answer
139 views

How can i lock a file then clear its contents and write to it? Clearing a file can be as simple as: FileOutputStream fos = new FileOutputStream(someFileObject); And acquiring the lock would be by: ...
Omar Alama's user avatar
0 votes
1 answer
106 views

In my project, i need to imeplement file locking and the problem is that we need to use java 6 only so what are the ways through which i can implement file locking for both platform(windows/linux)
mayank agrawal's user avatar
1 vote
0 answers
52 views

Is there any way to lock files of these types: txt pdf docx doc If locked, it should not be possible to edit, copy or print it.
CoderAlways's user avatar
437 votes
23 answers
378k views

How do I get the id of my Java process? I know there are several platform-dependent hacks, but I would prefer a more generic solution.
Dmitry Shechtman's user avatar
26 votes
6 answers
55k views

Currently I'm working on the project that does processing files from source directory in one of it's routines. There's a Java process that's looking for specified directory and tries to read and ...
Viktor Stolbin's user avatar
17 votes
8 answers
27k views

I need to start 1-3 external programs in my Java application that have paths defined by the user. I have few requirements: I don't want the program to execute if it is already running I don't want ...
Morinar's user avatar
  • 3,550
23 votes
3 answers
42k views

I have a process that will be called rather frequently from cron to read a file that has certain move related commands in it. My process needs to read and write to this data file - and keep it locked ...
bobtheowl2's user avatar
12 votes
5 answers
41k views

I'm trying to implement the following operation in Java and am not sure how: /* * write data (Data is defined in my package) * to a file only if it does not exist, return success */ boolean ...
Jason S's user avatar
  • 191k

15 30 50 per page
1
2 3 4 5