title: Are there ways of doing opendir(), readdir() type of calls through SSH/SFTP?
body: <p>I have a bit of code that reads a directory for files to process. I currently use the dirent.h,opendir(),readdir() methods of doing this. I have been told that I need to do the same thing, only now it is a directory on a remote machine with SSH/SFTP access. </p>
  
  <p>The only way (that I can think of) to do the same thing, without changing anything in the system except my source code, is to run a "ssh user@host ls" command, parse, and process based on the parsers results.</p>
  
  <p>The real question here is, are there ways of doing opendir(), readdir() (or something similar) through SSH/SFTP?</p>