<div dir="ltr">Thanks for your response.<br><div class="gmail_quote"><div dir="ltr"><div><br></div><div>This happened several weeks ago when I included source code of this library with my Android project and was stepping through it to understand what is happening in the library. Then it could not open files for reading, and after I made the above changes, it worked.</div>

<div><br></div><div>Today, after receiving your email, I again tested my project, which is now in working condition, with your "jcifs-1.3.17.jar", and to my surprise, it is working fine.</div><div>
<br></div><div>To find out why it was not working previously, I open the "SmbFile.java", and see there is a conditional block,</div><div><br></div><div>if( tree.session.transport.hasCapability( ServerMessageBlock.CAP_NT_SMBS )) {<br>

</div><div>.....</div><div>SmbComNTCreateAndX request = new SmbComNTCreateAndX( unc, flags, access, shareAccess, attrs, options, null );<br></div><div>......</div><div>} else {<br></div><div>
.....</div><div>send( new SmbComOpenAndX( unc, access, flags, null ), response );<br></div><div>.....</div><div>}</div><div><br></div><div>I am yet to figure out what "hasCapability" method above is doing, but if the control goes through "SmbComOpenAndX", it does not add <span style="font-family:arial,sans-serif;font-size:13px">FILE_READ_DATA flag (where '</span><font face="arial, sans-serif">desiredAccess' is set to 'SHARING_DENY_NONE' only</font><span style="font-family:arial,sans-serif;font-size:13px">).</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Is it possible that this was happening in my case earlier?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Best regards,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Somnath</span></div>

</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 6:26 AM, Michael B Allen <span dir="ltr"><<a href="mailto:ioplex@gmail.com" target="_blank">ioplex@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thu, Jun 6, 2013 at 3:27 AM, Somnath Kundu <<a href="mailto:skundu07@gmail.com" target="_blank">skundu07@gmail.com</a>> wrote:<br>


> Hello,<br>
><br>
> I was trying to use 'SmbRandomAccessFile' class with mode value "r" for<br>
> reading some file data, but it was not working. From the source code, it<br>
> appears that for mode value "r", the 'access' value remains set to '0', and<br>
> hence this problem. I had to modify the code as below to make it working.<br>
<br>
</div>Hi Somnath,<br>
<br>
SmbComNTCreateAndX automatically adds FILE_READ_DATA.<br>
<br>
Perhaps you should post precisely what actually happens and describe<br>
why you think it is in error.<br>
<div><br>
><br>
> BTW, what is the meaning of 'WRITE_OPTIONS' value as '0x0842' (as I do not<br>
> see any description in the code), and I see the default zero value is being<br>
> converted to '0x0040' later in the code?<br>
<br>
</div>Those are options specific to if the file is created. I don't recall<br>
what each bit actually means. I don't think they were documented when<br>
I wrote the code. They may be now.<br>
<br>
Mike<br>
<span><font color="#888888"><br>
--<br>
Michael B Allen<br>
Java Active Directory Integration<br>
<a href="http://www.ioplex.com/" target="_blank">http://www.ioplex.com/</a><br>
</font></span><div><div><br></div></div></blockquote></div></div></div></div></div></div>