[jcifs] Re: SMB_COM_CLOSE does work

Michael B. Allen miallen at eskimo.com
Thu Aug 22 04:27:15 EST 2002


On Wed, 21 Aug 2002 13:45:08 -0400
"Andrew Chernow" <achernow at unitedstoragetech.com> wrote:

> Michael,
>     I saw the message you posted about the lasted release of the jCIFS
> package.
> 
> >Didn't get a chance to do NamedPipes available() and it doesn't look
> >like setting last modified through SMB_COM_CLOSE works.
> 
> I wanted to let you know that I did get lastModified time working through
> SMB_COM_CLOSE.  I just did what you said, "...add a constructor to
> SmbComClose.java and pass the lastWriteTime...".  I made some modifications
> to accomplish this.

That's very good news. I must have done something wrong. My implementation
of this is in 0.7.0b2. It just doesn't work. Is there any chance you
can look at it and see what I did wrong?

> 
> SmbFile:
> added a close(long lastWriteTime) method.  The original SmbFile.close()
> method now reads:
> 
> void close()
> {
>    // this is set to the regular default that was being used, 0xFFFFFFFF
>    close(SmbComClose.DEFAULT_LAST_WRITE_TIME);
> }
> 
> public void close(long lastWriteTime)
> {
>    // same code as the original close() but changed this line
>    send(new SmbComClose(fid, lastWriteTime), new SmbComBlankResponse());
> }
> 
> 
> SmbFileOutputStream:
> added a close(long lastWriteTime) while simply calls
> smbfile.close(lastWriteTime);
> 
> 
> SmbComClose:
> added a constructor to accept lastWriteTime as argument.
> 
> I am not sure in what regards you are saying lastModified doesn't work, but
> in the above context I have no problems.  My solution was a quick hackish
> patch for my specific project.
> 
> Example:
> ----------------------------------------------------------------------------
> File file              = new File("/home/slakr/somefile.c");
> SmbFile smbFile = new SmbFile(smburl);
> 
> FileInputStream in           = new FileInputStream(file);
> SmbFileOutputStream out = new SmbFileOutputStream(smbFile);
> 
> while(....)
> {
>    // transfer the file
> }
> out.close(file.lastModified());
> in.close();
> ----------------------------------------------------------------------------
> -
> 
> Anyways, that's what I did and it works like a charm, after figuring out
> TimeZone s**t.
> 
> Thanks,
> /sLaKr
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and more importantly to tasks that have not
yet been conceived. 



More information about the jcifs mailing list