Ok
I git oart way through.
I can list my files but am having an issue getting file file info for an individual file
bwflista =SFTP.AccessService.file_info(conn, fremote_path)
tried look at record structures, but haven’t had any luck
get this info
Protocol.UndefinedError) protocol Enumerable not implemented for {:ok, %File.Stat{access: :read, atime: {{2020, 8, 30}, {17, 45, 50}}, ctime: :undefined, gid: 0, inode: 0, links: 1, major_device: 0, minor_device: 0, mode: 33133, mtime: {{2020, 8, 30}, {17, 45, 50}}, size: 8723608, type: :regular, uid: 0}} of type Tuple
Looks like you just need to pattern match on the return value of SFTP.AccessService.file_info
case SFTP.AccessService.file_info(conn, fremote_path) do
{:ok, bwflista} -> # success, do something with bwflista
{:error, reason} -> # handle error
end
Thanks
i used the following that seems to work
case SFTP.AccessService.file_info(conn, fremote_path) do
{:ok, bwflista} -> IO.inspect bwflista.atime # success, do something with bwflista
#{:error, reason} -> # handle error
end