[jcifs] Hidden Files from listFiles()?

Christopher R. Hertel crh at ubiqx.mn.org
Tue Nov 4 15:18:30 EST 2003


On Mon, Nov 03, 2003 at 11:08:27PM -0500, Michael B Allen wrote:
> I am implementing SmbFileFilter (and SmbFilenameFilter) and will provide a
> DosFileFilter( String wildcard, int attributes ). If we can filter by
> attributes should the non-filtered listFiles operations return hidden
> files? If so that will break backward compatibility. If users want hidden
> files, instead of doing:
> 
>     dir.listFiles( "*" );
> 
> they will need to use:
> 
>     DosFileFilter dff = new DosFileFilter( "*",
>         ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM );
>     dir.listFiles( dff );
> 
> to get them. Or if we include hidden files by default they could do the
> following to exclude them:
> 
>     DosFileFilter dff = new DosFileFilter( "*",
>         ATTR_DIRECTORY | ATTR_SYSTEM );
>     dir.listFiles( dff );
> 
> I think I'm leaning toward case 2 just because jCIFS is more likely to be
> used to utilitarian purposes as opposed to casually perusing through files
> with the capacity to delete something by accident.

I would tend toward leaving hidden files hidden.  Even in Unix you have to 
specifically ask to see the hidden files.  My gut reaction is that this is
the path of least surprise.

> Chris,
> 
> Have you ever noticed ATTR_READONLY and ATTR_ARCHIVE are basically ignored
> by TRANS2_FIND_FIRST2/NEXT2?

No, but now I know to look for it.  :)
Interesting how this stuff works (or doesn't).

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org



More information about the jcifs mailing list