I have been using Net::FTP::Recursive. They are now changing our server to SFTP only. In the current program that I use to pull the directory listing, I'm using the rdir attribute. It pulls a listing like

/########/ST_(en)/_20150109 d /########/ST_(en)/_20150206 d /########/ST_(en)/_20150306 d /########/ST_(en)/_20150407 d /########/ST_(en)/_20150507 d /########/ST_(en)/_20150610 d /########/ST_(en)/_20150708 d /########/ST_(en)/_20150810 d /########/ST_(en)/_20150910 d /########/ST_(en)/_20151012 d /########/ST_(en)/_20151111 d /########/ST_(en)/_20151211 d /########/ST_(en)/_20160111 d /########/ST_(en)/_20160210 d /########/ST_(en)/_20160309 d /########/ST_(en)/_20160411 d /########/ST_(en)/_20160509 d /########/ST_(en)/_20160610 d /########/ST_(en)/_20160711 d /########/ST_(en)/_20160810 d /########/ST_(en)/_20160912 d /########/ST_(en)/_20161010 d /########/ST_(en)/_20150109/Database.zip f /########/ST_(en)/_20150206/Database.zip f /########/ST_(en)/_20150306/Database.zip f /########/ST_(en)/_20150407/Database.zip f /########/ST_(en)/_20150507/Database.zip f /########/ST_(en)/_20150610/Database.zip f /########/ST_(en)/_20150708/Database.zip f /########/ST_(en)/_20150810/Database.zip f /########/ST_(en)/_20150910/Database.zip f /########/ST_(en)/_20151012/Database.zip f /########/ST_(en)/_20151111/Database.zip f /########/ST_(en)/_20151211/Database.zip f /########/ST_(en)/_20160111/Database.zip f /########/ST_(en)/_20160210/Database.zip f /########/ST_(en)/_20160309/Database.zip f /########/ST_(en)/_20160411/Database.zip f /########/ST_(en)/_20160509/Database.zip f /########/ST_(en)/_20160610/Database.zip f /########/ST_(en)/_20160711/Database.zip f /########/ST_(en)/_20160810/Database.zip f /########/ST_(en)/_20160912/Database.zip f /########/ST_(en)/_20161010/Database.zip f

I need to find a way to do the same thing using SFTP. Any suggestions. In this case the formatting of the file listing is relatively important to not needing to make major changes elsewhere. The remote server is a Windows server with the directory structure in Unix mode.


In reply to FTP->SFTP directory listing by gouldopfl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.