[jcifs] Has anybody else seen problems with file names that start with a dot?

Dan Dumont fantom2000 at yahoo.com
Wed Nov 5 14:32:33 EST 2003


I'm glad you emailed about this because today
something funny happened in my code as well.

A directory on a smbserver at my school has a folder
within it with the name of (near as i can tell) " ".

Thats just a plain old space  ascii 20(hex).
... I can sense mike squirming, but I thought this
deserved some looking into.

Anyway, when I use listFiles and ger back an array
of SmbFiles on the parent of the dir that has a space
for a name, Instead of getting an SmbFile with a name
of " " i get the absolute root ambfile that i started
with (namely, nothing more than the ip address.  It
even behaves like the root smbFile.  very bad for
recursion, as you can well guess...)

Anyway.  I have patched my code for the time being by
adding another condition on weather to recurse
further.   However, it still may be worth looking
into.
 
> --- Marc Savereux <marc.savereux at rogers.com> wrote:
> > When using jcifs-0.7.14.jar and using the list()
> and
> > listFiles() methods I noticed that the files that
> > start with a dot are not treated the same.
> > 
> > With an actual file name of ".profile" without the
> > double quotes, building a directory listing using
> > the list() method will retain the dot as the first
> > character of the file name, however, building a
> > directory listing via the listFiles() method will
> > result in the dot being substituted by a space.
> > 
> > list() -> ".profile"
> > listFiles() -> " profile"
> > 
> > However, I am able to create files that start with
> a
> > dot via the jcifs libraries on file systems other
> > than FAT and FAT32.
> > 
> > I'm just wondering if anybody else has encountered
> a
> > problem like mine when comparing the result sets
> of
> > an array of strings built via list() and an array
> of
> > SmbFile objects via listFiles()?
> > 
> > I would think that the listFiles() behaviour I am
> > seeing with files that start with a dot is not
> > intended behaviour.
> > 
> > Marc Savereux
> > marc.savereux at xaro.com
> 
> 
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
> 


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree



More information about the jcifs mailing list