Results 1 to 2 of 2
Thread: Java File lock mechanism
- 09-17-2012, 07:50 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 23
- Rep Power
- 0
Java File lock mechanism
Hello,
I have used RandomAccessFile J2SE 6 class to implement lock mechanism on .xml file.
I want a mechanism that .xml file should be locked for "rw" [read write] but it should be opened to "r" [read] mode.
objFileChannel.tryLock(0L, Long.MAX_VALUE, true); This function locks the .xml file with sharing allowed. But it opens the .xml in all the cases even if i want to open .xml in read write mode or it's only read mode.
What should i use for sharing the lock mechanism for that file?
Thanks in advance.
- 09-17-2012, 06:46 PM #2
Member
- Join Date
- Sep 2012
- Posts
- 70
- Rep Power
- 0
Similar Threads
-
Java 1.0 event handling mechanism....
By Cosmos in forum Advanced JavaReplies: 2Last Post: 10-23-2011, 08:58 PM -
Record Lock in Java
By sfaisalawan in forum JDBCReplies: 1Last Post: 05-08-2011, 08:10 AM -
Ldap bind mechanism in java
By ppo in forum Advanced JavaReplies: 5Last Post: 06-10-2010, 03:25 AM -
Logger and file lock
By segolas in forum Advanced JavaReplies: 3Last Post: 01-14-2010, 04:02 PM -
lock a file
By flaca in forum New To JavaReplies: 3Last Post: 08-19-2008, 03:00 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks