[jcifs] RE: [Fwd: SmbTree copy()]

Michael B. Allen mballen at erols.com
Wed Oct 31 07:17:32 EST 2001

On Tue, Oct 30, 2001 at 10:05:07AM -0800, rjw wrote:
> Allen, Michael B (RSCH) wrote:
> > Yikes. What does this program do? It's endless Node Status and 
> > Trans2QueryInformation requests.
> Yes, it's lots of requests. I'm quite unsure why that is, to be honest. 
> The snippet of the log does nothing but attempt to copy a file and then 
> does a list() on the destination folder to get an updated view (granted 
> this isn't optimum, but that's the way it is now. =)  There's some other 
> setup-tpe stuff before-hand... does everything exists, blah, blah, blah.

Mmm, every time you call exists a message goes out on the network. I think
you should drop those. I'll be releasing jcifs-0.6b pretty soon. That
should be better. An interesting artifact of exceptions being thrown
is that some calls are made more directly eliminating certain network
calls. In general is less chatty.

> > Yeah, this all should work. It looks right. PS you can easily get tid2
> > from dest.tree.tid. Then, presuming, you get it working you can also do
> > copies accross shares without going through the client. If I have time,
> > maybe I'll look into fixing this.
> Ah, I'll have a loot at that!
> > 	That 'test' directory exists right?
> Aye, test exists. The last bit of log should actually be an 
> SmbFile.list() of test after the copy failed.
> Thanks for the assistance, I'll look into more deeply into the problem. 
> If I get it working, I'll let you know...

Create a very simple program like:

public class CopyTo {
	public static void main( String[] argv ) throws Exception {
		SmbFile from = new SmbFile( argv[0] );
		from.copyTo( new SmbFile( argv[1] ));

This should be much easier to interpret. I think you really need a packet
sniffer or you're dead in the water. Run Ethereal on a machine within
listening distance of an NT workstation. Then do a copy in cmd.exe on a
file on a share. You'll see the whole thing broken down in Ethereal. Then
try your jCIFS copyTo and you'll see what the problem is.

May The Source be with you.

More information about the jcifs mailing list