[jcifs] File locking redux

Rob Wygand rob at filefish.com
Fri Sep 28 09:23:07 EST 2001


All,

I'm seeing another weirdness with file locking in JCFIFs. This one has 
to do with when a process on another machine has a file open. The scenario:

There is a word document file at smb://machine/share/foo.doc

I start word on a windows machine and open this file via my Network 
Neighborhood.

I then use JCFIS to try and fetch this document by grabbing an 
SmbFileInputStream. This fails with "ERRDOS/ERRbadshare: The file is 
being used by another process"

If I use another windows Machine I can open this file read-only. Also, 
of I use Samba (smbclient), I get 'download' the file to my local machine.

It seems like JCIFs being too strict with it's locks and is treating 
read-locks as write-locks? I was looking through 
SmbComNTCreateAndX.java,but I have not seen anything that leapt out at me.

rjw

-- 
"They that can give up essential liberty to obtain a little
  temporary freedom deserve neither liberty nor safety."





More information about the jcifs mailing list