B4J Question [ SOLVED ] SSHJSFTPResourceInfo bug

moore_it

Well-Known Member
Licensed User
Longtime User
Hi all,

i need to get the date of remote files with sftp protocol.
I use SSHJ and SSHJSFTPResourceInfo for that, but when i use the method getAtime or getMtime then date is always 19.01.1970.
Where i wrong ?

Thanks

This is code i use for that

B4X:
Dim mssh As SSHJ
mssh.Initialize2("SSHJ",90)
mssh.AddHostKeyPromiscuousVerifier
mssh.AddAuthPassword(m.Get("s04"))
mssh.Connect(server,port,user)
Dim msftp As SSHJSFTPClient = mssh.GetSFTPClient
msftp.List(path)
wait for SSHJ_SFTPListFinished (Success As Boolean, Path As String, ListOfResourceInfo As List)
For Each obj As SSHJSFTPResourceInfo In ListOfResourceInfo
      If obj.IsDirectory = False Then
         datetime.dateformat = "dd/MM/yyyy"
         dim dt as string = datetime.date(obj.getmtime) "always 19/01/1970"
      end if
next
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…