[jcifs] RE: That SMB_COM_CLOSE thing...

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Tue Aug 20 14:48:40 EST 2002


> -----Original Message-----
> From:	Christopher R. Hertel [SMTP:crh at ubiqx.mn.org]
> Sent:	Monday, August 19, 2002 11:28 PM
> To:	Allen, Michael B (RSCH)
> Cc:	jcifs at samba.org
> Subject:	Re: [jcifs] RE: That SMB_COM_CLOSE thing...
> 
> On Mon, Aug 19, 2002 at 10:56:50PM -0400, Allen, Michael B (RSCH) wrote:
> > I'll create a new jar with a copyTo() that uses SMB_COM_COPY in a minute.
> > 
> > But here's something else that looks like it might be broken.  You're 
> > supposed to be able to specify a UTIME in SMB_COM_CLOSE of the "Time of
> > last write". I just tried it with NT4 and it didn't work. It uses the
> > current time regardless.
> > 
> > I've prepared a jar that illustrates this behavior. If you use the CopyTo
> > example it will submit the last modified time of the source file in the
> > SMB_COM_CLOSE operation for the destination file (to save a setattr in
> > light of no SMB_COM_COPY). You can see it in the trace. But when you
> > look at the time in Explorer of the new file it has the current time.
> > 
> >   http://users.erols.com/mballen/jcifs-0.7.0bCloseTime.jar
> 
> People are leaving the lab, wanting to get some sleep to keep up their 
> strength for the rest of the week I guess.  :)  I'll start testing 
> CloseTime.jar tomorrow when people are around.  I assume that the CopyTo 
> example in CloseTime.jar uses the "fixed" version of CopyTo (which doesn't 
> use SMB_COM_COPY).  Is that correct?
> 
	Well, "fixed" in that it just reads from the source and writes to the destination
	but yes, it does not use SMB_COM_COPY.

	I have however prepared a super SMB_COM_COPY experimenter's dream of a
	jar file:

	http://users.erols.com/mballen/jcifs-0.7.0bCopy.jar

	The copyTo() method in this jar *does* use SMB_COM_COPY. And
	successfully if you useUnicode = false and you do not write the 0x4 format
	codes before each string. Doesn't look like ethereal decodes much of it but
	Netmon sure does.

	I've made it so you can change just about every SMB_COM_COPY parameter
	using jCIFS properties. Here's the list:

	jcifs.smb.client.copy.openFunction.create = 1
	jcifs.smb.client.copy.openFunction.open = 0
	jcifs.smb.client.copy.flags.mustBeFile = 1
	jcifs.smb.client.copy.flags.mustBeDir = 0
	jcifs.smb.client.copy.flags.targetAscii = 0
	jcifs.smb.client.copy.flagst.sourceAscii = 0
	jcifs.smb.client.copy.flags.verifyAllWrites = 0
	jcifs.smb.client.copy.flags.treeCopy = 0
	jcifs.smb.client.copy.useFmtCodes = false

	See the Leach doc for the details on these fields. They're named accordingly.
	Remember you only have to specify the last label of these properties unless
	it's ambiguous like:

	mustBeFile = 0
	mustBeDir = 1

	Have fun and watch out for blue screens!

	Mike




More information about the jcifs mailing list