[jcifs] Checking file locks

Michael B Allen ioplex at gmail.com
Mon Oct 27 17:33:42 GMT 2008


On Mon, Oct 27, 2008 at 9:50 AM, Volker Müller
<volker.mueller at xsystem.de> wrote:
> Hello,
>
> I spent some time on trying to determine the locks (file lock, oplock)
> of a file.
> After all, I have'nt found a way to check the lock without locking the file.
>
> My application has a lot of threads opening files on a netApp-Filer. The
> same file may be opened from various clients.
> In this scenario I need something like a checkLock()-methode to
> determine the file lock without blocking the access for other clients
> (in case of reading access). The result should only displayed in the
> GUI, the file will not be opened in all cases.
>
> Have someone an idea how to solve the problem?

Hi Volker,

We do not have locking support and I don't know enough about it to
give you a definitive answer. But JCIFS is fairly easy to hack on and
locking flags are decoded (e.g.
jcifs/smb/SmbComNTCreateAndXResponse.java). If there is a way to do
what you want it's probably not too difficult to do with JCIFS.

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list