Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

kuzyaka

Re: The RemoteFileInfo.LastWriteTime.Millisecond value is always 0.

I thought so.
In my opinion, the simplest and most reliable solution would be to reset the milliseconds of the local file:
Dim fiLocalFile As New FileInfo("PathToLocalFile")
Dim rfiRemoteFile As RemoteFileInfo
rfiRemoteFile = sessionSSH.GetFileInfo("PathToRemoteFile")
 
fiLocalFile.LastWriteTime.AddMilliseconds(-fiLocalFile.LastWriteTime.Millisecond) = rfiRemoteFile.LastWriteTime = True
kuzyaka

Re: The RemoteFileInfo.LastWriteTime.Millisecond value is always 0.

How, then, to learn that the local and remote files are the same?
martin

Re: The RemoteFileInfo.LastWriteTime.Millisecond value is always 0.

Very few servers (if any at all) provide timestamps with milliseconds precision.
kuzyaka

The RemoteFileInfo.LastWriteTime.Millisecond value is always 0.

After sending the file to the SSH server, the RemoteFileInfo.LastWriteTime.Millisecond value becomes 0.
Therefore, the date value of the local file is almost always greater than the date value of the remote file.
Dim fiLocalFile As New FileInfo("PathToLocalFile")
Dim rfiRemoteFile As RemoteFileInfo
rfiRemoteFile = sessionSSH.GetFileInfo("PathToRemoteFile")
 
fiLocalFile.LastWriteTime > rfiRemoteFile.LastWriteTime = True

Why the value of RemoteFileInfo.LastWriteTime.Millisecond is equal to 0?