Exclusive file lock

B

Bruintje Beer

Hi,

I was wondering if there is a way to open a data file in exclusive mode not
using the nio package. The reason for not using the nio package is not
relevant I am just interrested in some kind of solution.

John
 
H

Hunter Gratzner

I was wondering if there is a way to open a data file in exclusive mode not
using the nio package. The reason for not using the nio package is not
relevant

So you thing we are not worthy to know some background. But we should
be glad to be at your service.

Hint: Hire a consultant if you need to have someone you can push
around.
 
D

Daniel Pitts

Bruintje said:
Hi,

I was wondering if there is a way to open a data file in exclusive mode not
using the nio package. The reason for not using the nio package is not
relevant I am just interrested in some kind of solution.

John
Exclusive file locks are often OS specific, and as such difficult to
have a OS neutral implementation.
 
A

Arne Vajhøj

Bruintje said:
I was wondering if there is a way to open a data file in exclusive mode not
using the nio package. The reason for not using the nio package is not
relevant I am just interrested in some kind of solution.

Write some C code and call it via JNI.

Arne
 
E

EJP

The reason for not using the nio package is not

Your reason for not using the only package that provides a solution is
*extremely* relevant.

You only have to use NIO for the lock, not for the I/O. Start with a
FileInputStream or RandomAccessFile, get the FileChannel from that, and
lock the file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top