EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP for file synchronisation

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#14466
Posted: 09/15/2010 23:25:36
by timn (Standard support level)
Joined: 06/29/2010
Posts: 7

I am trying to use the SFTP client part of SecureBlackBox to do a synchronising of a directory. All files in a directory on a SFTP/SSH server are compared to a directory locally. If any of the files differ, it will grab them off the server. Currently I am using file size and time stamp comparisons. The time stamps however are not correct.

The question I have:
How do I retain the original (server side) time stamps of the downloaded files?

A few other related questions:
What do the OpenFileSync and OpenDirectorySync methods on TelSftpClient do?
Where can I find documentation on these methods?
Is there a better way to do this? File hashing for example?

Cheers,
Boyd

Using SBB 8.0.176, Visual Studio 2008 SP1 and .Net 3.5
#14473
Posted: 09/16/2010 09:21:09
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

Quote
The time stamps however are not correct.

Could you please elaborate a little on this? Which exactly timestamps (local or server-side) are not correct and what is the measure of "incorrectness"?

Quote
How do I retain the original (server side) time stamps of the downloaded files?

Please set the AdjustFileTimes property to true to have the timestamps retained after download.

Quote
What do the OpenFileSync and OpenDirectorySync methods on TelSftpClient do?

They open a remote file or directory in synchronous way (i.e., the methods block until the file or directory is opened).

Quote
Where can I find documentation on these methods?

Thank you for letting us know about the issue. The corresponding topics did not get to the documentation for some reason. Will be fixed as soon as possible.

Quote
Is there a better way to do this? File hashing for example?

A better way to do... file comparison, I assume? Remote file hashing in general is not supported by SFTP (some versions do declare means for remote hashing, however, most of the servers do not support it). How do the files get to the server? Would it be possible to add some metadata to them (e.g. in form of <filename>.md5 files) at the time when they are uploaded there?
#14516
Posted: 09/20/2010 18:04:10
by timn (Standard support level)
Joined: 06/29/2010
Posts: 7

Thank you for your clear and helpful reply!
Quote
Could you please elaborate a little on this? Which exactly timestamps (local or server-side) are not correct and what is the measure of "incorrectness"?

This turned out to be a problem with not considering timezones, I have since switched to using UTC time stamps
Quote
Please set the AdjustFileTimes property to true to have the timestamps retained after download.

This is exactly what I would like to do... Where can I find this property?

Cheers,
Boyd
#14518
Posted: 09/21/2010 05:10:21
by Ken Ivanov (EldoS Corp.)

AdjustFileTimes is a property of TElSimpleSFTPClient class.
#14544
Posted: 09/22/2010 19:17:15
by timn (Standard support level)
Joined: 06/29/2010
Posts: 7

I am currently using TElSftpClient rather than the Simple client because I am also doing some port forwarding/tunnelling to the same SSH server.
It appears that I can't use the simple client in combination with ElSSHClient.
i.e. Passing it a tunnel to use.

Is there an equivalent property of the TElSftpClient class?
I am using the "SophisticatedClient" example provided with the documentation as a template.

Thanks for your help.

Cheers,
Boyd
#14548
Posted: 09/22/2010 22:17:56
by Ken Ivanov (EldoS Corp.)

TElSftpClient does not expose AdjustFileTimes property as it does not deal with physical files. I will provide you more information on adjusting file times with TElSftpClient in the Helpdesk ticket, which I have created for you.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 1287 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!