[jcifs] Problem setting attributes for directories

Michael B Allen mba2000 at ioplex.com
Tue Jun 28 02:27:36 GMT 2005


This is fixed. The bits that you can actually set are:

0x2000 - Content Indexed
0x1000 - Offline
ATTR_NORMAL
ATTR_ARCHIVE
ATTR_SYSTEM
ATTR_HIDDEN
ATTR_READONLY

All other bits (e.g. 0x7000 - Encrypted) are ignored or generate an error
on the remote end so they are masked out if you attempt to set them. But
all defined bits (0x7FFF) will be returned by getAttributes (as they did
before).

To be released in 1.2.1 RSN.

Mike

Michael B Allen said:
> On Mon, 20 Jun 2005 19:56:38 +0200
> Thomas Bley <bley at in.tum.de> wrote:
>
>> using:
>>          f.setAttributes( f.getAttributes() | f.ATTR_HIDDEN );
>>
>> gives me:
>> Exception in thread "main" jcifs.smb.SmbException: Access is denied.
>> 	at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:436)
>
> What does this do?:
>
>    f.setAttributes( f.ATTR_HIDDEN );
>
> If it still fails it's not a bug in the mask as I previously thought. From
> glancing at the code I can see there is a mask used to filter what
> attributes can be set so it's probably a bug in the flags/options used
> to open the file. I will have to look at a packet capture and compare
> to see where we're going wrong.
>
> Mike
>
>



More information about the jcifs mailing list