[jcifs] Re: SmbFile(

Christopher R. Hertel crh at ubiqx.mn.org
Sat May 29 20:11:58 GMT 2004


On Sat, May 29, 2004 at 07:56:13PM +0000, David Emo. wrote:
> Christopher R. Hertel <crh <at> ubiqx.mn.org> writes:
> 
> > 
> > On Sat, May 29, 2004 at 04:54:55PM +0000, David Emo. wrote:
> > > Hi, first i'd like to thank for your great job. It's really powerfull and 
> > > usefull. 
> > > I have some problem with the line :
> > >....
> 
> Thanks, for your answer. 
> I read the FAQ but i don't see where is my problem. I do the netstat test to 
> check that i have well a netbios server on. I don't really see what is the 
> problem.

The URL 'smb://' refers to a workgroup, not a server.  When you try to
find the members of the workgroup, the request gets sent to the Local
Master Browser.  If you get a 'Name not found' error, it's because jCIFS 
could not find the Local Master Browser.  There are two possible reasons 
for this:

1) There is no Local Master Browser on the local subnet.
2) You have misconfigured jCIFS' name resolution system.

> For the third question i made mistake, you should read :
> SmbFile smbf = new SmbFile("smb://computer1/Projets Annexes/");
> smbf.list();
> I have no mangled directory name in the directory. I can see it with all my 
> machines.
> 
> I keep searching...

Yes, you need to keep searching.  Try here:
  http://www.linux-mag.com/cgi-bin/printer.pl?issue=2001-05&article=smb

As I explained, the problem is that the NetShareEnum() call does not 
return names longer than 12 bytes.  It can't.  So, the name "Projets 
Annexes" is too long for the function call to return.  Note that 
NetShareEnum() is a Windows (and OS/2) RAP function.  The limitation was 
introduced years ago.

That's why your request for "smb://computer1/Projets Annexes/" works.  The 
limitation is not a jCIFS limit nor is it a limit of the SMB protocol.

If you use a Windows98 client then you'll have the same problem.  Newer 
versions of Windows use a different function to retrieve share names.  
Implementing this newer function is much more complex, and jCIFS does not 
*yet* have it working.

Note that "Projets Annexes" is *not* a directory name (not from the SMB 
point of view).  From the protocol's point of view it is a "share name".
You can simply shorten the name of the share in the share configuration 
and you'll be able to see it.

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