[jcifs] Issue: hidden children omitted from folder content list

madlg3 at vodafone.es madlg3 at vodafone.es
Wed Feb 4 16:16:42 GMT 2004


Hi,

The list for hidden files works fine for jcifs 0.7, but in jcifs-
0.8.0b  there is a problem when setting the search attributes in the 
frame FIND_FIRST2. The problem is that smbFile  passes 0x14 as 
parameter instead of 0x16 which allows hidden files to be read. 

In jcifs 0.7.15 this attribute was set like that in Trans2FindFirst2:
searchAttributes = ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM;
This  is equals to 0x16 and allows hidden directories to be shown.

But in 0.8 this happens:

public SmbFile[] listFiles( String wildcard ) throws SmbException {
        return listFiles( wildcard, ATTR_DIRECTORY | ATTR_SYSTEM, null, 
null );
    }
    public SmbFile[] listFiles( SmbFilenameFilter filter ) throws 
SmbException {
        return listFiles( "*", ATTR_DIRECTORY | ATTR_SYSTEM, filter, 
null );
    }

And ATTR_DIRECTORY | ATTR_SYSTEM is equals 0x14, that means that the 
second bit is null and no hidden files are to be shown.

Regards,

Miguel de Luna






----- Mensaje Original -----
De: Julian Reschke <julian.reschke at gmx.de>
Fecha: Miércoles, Febrero 4, 2004 2:08 pm
Asunto: [jcifs] Issue: hidden children omitted from folder content list

> Hi,
> 
> it seems that list() doesn't return children that are hidden. Test 
> case:
> 	private static void testListHidden() throws IOException {
> 
> 	        SmbFile folder = new SmbFile("smb://" + creds + host + 
> "/" + share + 
> "/folder2/");
> 	        folder.mkdir();
> 	        
> 	        SmbFile smb = new SmbFile("smb://" + creds + host + "/" 
+ 
> share + 
> "/folder2/test");
> 	        SmbFileOutputStream so = new SmbFileOutputStream(smb);
> 	        so.write("Hello".getBytes());
> 	        so.close();
> 	        
> 	        smb.setAttributes(smb.getAttributes() | 
smb.ATTR_HIDDEN);
> 	        
> 	        System.out.println("folder child count: " + 
> folder.list().length);	}	
> 
> yields:
> 
> folder child count: 0
> 
> 
> (the good news is that setAttributes() does indeed work :-)
> 
> 
> Regards, Julian
> 
> -- 
> <green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
> 
> 


__________________________________________________________________
Vodafone publicidad: Comunicarte con teléfonos fijos puede ser ahora 
tan barato como hacerlo desde el móvil. Porque ahora también puedes 
enviar SMS a teléfonos fijos de Telefónica de España por sólo 0,15 
euros (i.i.no incl.), según plan de precios. Infórmate en  
www.vodafone.es o llamando al 123 (llamada sin coste).



More information about the jcifs mailing list