[jcifs] a bug

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Tue Jan 15 15:40:20 EST 2002

> -----Original Message-----
> From:	Dmitry Krasnikov [SMTP:duke at land81.nsu.ru]
> When i have downloaded jCIFS first time it was 0.6b5 version. I've tried
> to use it to list dirs, containing upper-127 characters in name and came
> to a strange bug - we could get dir listing using listFiles() and we could
> get file names but exception was thrown when we tried to get size of
> files...
	What kind of Exceptions? What bug do you refer to?

	So does this trigger the problem?

	import java.net.*;
	import jcifs.smb.*;

	public class LF {

	    public static void main( String[] argv ) throws Exception {
	        SmbFile[] list;

	        SmbFile dir = new SmbFile( "smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9" );

	        list = dir.listFiles();
	        for (int i = 0; i < list.length; i++) {
	            System.out.println( list[i] + " " + list[i].length() );

	I get

	[miallen at miallen2 examples]$ java -Djcifs.properties=../../miallen.prp LF
	smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9/d0.c 1306
	smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9/d1.c 799
	smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9/goob 0
	smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9/lib 0
	smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9/Makefile 207
	smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9/README.txt 1426
	smb://miallen1/Download/%ED%D5%CC%D8%D4%C9%CB%C9/s3.xml 921

	Which looks like it's working for me.

	I need more information. Can you reproduce the problem consistently?

	Are there many files in the directory?

	Does the problem go away if you change these properties to:


	If so which setting?

	Can you capture a trace with -Dlog=ALL VM flag while this happends? Send it to me directly.

	PS: You know you don't have to URL encode those Russian characters. It's just a few meta characters like + and space ...etc.

>  I came to site and discovered that 0.6b8 was out with description
> of my bug. Then i downloaded it and ... everything was ok, untill i've
> tried to get listing of other russian-named directory.
> i' ve got very strange bug: 
>  getting contents of
> smb://ws161.land7.nsu.ru/Video/%ED%D5%CC%D8%D4%C9%CB%C9/
> listing getted
> parsing 0
> parsing 1
> янв 14 20:14:33.645 - exception reading from socket input
> java.net.SocketException: Socket closed
>         at java.net.SocketInputStream.read(SocketInputStream.java:84)
>         at
> jcifs.netbios.SessionServicePacket.readPacketType(SessionServicePacket.java:68)
>         at jcifs.netbios.SocketInputStream.read(SocketInputStream.java:73)
>         at jcifs.netbios.SocketInputStream.read(SocketInputStream.java:39)
>         at java.io.FilterInputStream.read(FilterInputStream.java)
>         at java.io.PushbackInputStream.read(PushbackInputStream.java)
>         at jcifs.smb.SmbTransport.run(SmbTransport.java:308)
>         at java.lang.Thread.run(Thread.java)
> parsing 0,parsing 1 ment that program got listFiles() array and parsed
> getName() strings (or how it will be)
> looking for fixes i have changed SmbTransport class to 0.6b5 version and
> everything worked fine even my troubles with urlencoded russian characters
> disappeared... but i'
> i hope that helps you.
> WBR, Dmitry.
> =[mailto:mainpart at chat.ru]=[mailto:mainpart at mail.ru]=[ICQ:75279462]=

More information about the jcifs mailing list