Is there a way to get the files from SFTP server that should be based on modified date using Tamir.SharpSsh? Currently I am downloading files by file name but my requirement
SharpSsh does not allow that. It's a dead project, do not use it.
Anyway, I took a look at the code to assess how difficult it would be add possibility to retrieve file timestamp using the Sftp.GetFileList
(since the library is open source).
You would have to:
ChannelSftp.LsEntry
SSH_FXP_NAME
packet to the ChannelSftp.ls
methodSftp.GetFileList
to return not only file name, but also the timestamp (and other file metadata).Alternatively, you can use WinSCP .NET assembly. You can use its Session.GetFiles method with a file mask. E.g. a file mask *>7D selects all files modified in the last week.
(I'm the author of WinSCP)