[jcifs] Preserve lastModified TIME
Allen, Michael B (RSCH)
Michael_B_Allen at ml.com
Wed Aug 14 15:49:35 EST 2002
First, please send these messages to the list.
> -----Original Message-----
> From: andy chernow [SMTP:achernow at yahoo.com]
> Sent: Wednesday, August 14, 2002 1:43 AM
> To: Allen, Michael B (RSCH)
> Subject: RE: [jcifs] Preserve lastModified TIME
>
> That worked. For testing I just modified line 35 in
> SmbComClose,
> from: lastWriteTime = 0xFFFFFFFF;
> to: lastWriteTime = 1009271236L;
> Also changed lastWriteTime to a long for the test. I
> just got the epoch of a file on my system and stuck it
> in there for the test, converting it from milli to
> sec.
>
> An interesting note: Windows, Java and the Linux
> server all had different ideas about what hour it was.
> Ahh, dates and times...
>
> Windows: right-clicked properties on the file
> Tuesday, December 25, 2001, 5:07:16 AM
>
> Java: new Date(theFile.lastModified())
> Tue Dec 25 04:07:16 EST 2001
>
> RedHat 7.3: stat theFile
> Tue Dec 25 09:07:16 2001
>
> I guess I have to fiddle with TimeZones. (yuck)
>
Just do the reverse of ServerMessageBlock.readTime(). There
may even be a writeTime somewhere. Are you a grepper?
> Thank you,
> /sLaKr
>
> --- "Allen, Michael B (RSCH)" <Michael_B_Allen at ml.com>
> wrote:
> > The SMB_COM_CLOSE command provides a time field that
> > should specify
> > the last modified time to be set on the file.
> > Provided the documentation is
> > correct this should be simply a matter of adding a
> > constructor parameter to
> > SmbComClose but there is currently no way to
> > communicate to an SmbFile
> > what time should be used (although this would be
> > great for copyTo).
> >
> > > -----Original Message-----
> > > From: andy chernow [SMTP:achernow at yahoo.com]
> > > Sent: Tuesday, August 13, 2002 11:14 PM
> > > To: jcifs at lists.samba.org
> > > Subject: [jcifs] Preserve lastModified TIME
> > >
> > > Just curious if there is a way to preserve the
> > > lastModified time of a local file when
> > transporting it
> > > to a Samba or NT Server. Is there such a Flag
> > within
> > > the protocol?
> > >
> > > I searched through some of the ServerMessageBlock
> > > sub-classes and only found mention of file times
> > > within a response packet,
> > SmbComNTCreateAndXResponse.
> > > I looked in SmbComNTCreateAndX and noticed that
> > within
> > > the writeParameterWordsWireFormat method, the
> > filetime
> > > attributes are not sent. I am not very familiar
> > with
> > > the SMB protocol so I guess I am curious if this
> > can
> > > be done? If it can and jcifs currently doesn't
> > > support preserving filetimes, I will try to
> > implement
> > > it myself. Just don't want to go at something the
> > > protocol doesn't support.
> > >
> > > I basically only need to preserve the lastModified
> > > time when creating a new file on server.
> > Currently
> > > when I transfer a file to the server, it's
> > > lastModified time is the time in which it was
> > written.
> > >
> > > I am shooting for some incremental functionality.
> > >
> > > /sLaKr
> > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > HotJobs - Search Thousands of New Jobs
> > > http://www.hotjobs.com
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
More information about the jcifs
mailing list