[jcifs] jcifs.smb.SmbException: Cannot create a file when that file already exists.

Michael B Allen mba2000 at ioplex.com
Fri Jun 2 17:10:50 GMT 2006


On Fri, 2 Jun 2006 06:34:26 -0700 (PDT)
Filip Orelj <chicholinac at yahoo.com> wrote:

>  
>   Hi,
>   Trying to create an instance of SmbRandomAccessFile 
>   with jcifs-1.2.9 I'm getting this exception:
>    “jcifs.smb.SmbException: Cannot create a file when that file already exists.”
>   (Windows XP SP1)

This could be because of the changes in open flags used to facilitate
the security descriptors patch but from glancing at the code I don't
see a difference in the upper level code. I suspect it's problably a
change in the default flags used in the SmbComNTCreateAndX class. I'll
add this to The List.

>   I used version 1.2.4 as previous one and everything worked fine.
>    
>   Any idea, experience, patch?

It's probably just a matter of adding another flag in
SmbRandomAccessFile.java to the file.open() call. The best way to do
this would be to crank up logging to see what the openFlags of the
SmbComNTCreateAndX command are for the old version that worked and the
new version that doesn't. I bet there's a difference. If so post the
two values here and I'll tell you what flag to add.

Mike


More information about the jcifs mailing list