title: WinSCP Session::RemoveFiles - Delete specified files in sub directories
body: <p>[Question] Does <code>Session::RemoveFiles()</code> remove files in sub directory of source directory? If not, how to implement this ability?</p>
  
  <p>(Please do not ask me why I have the remote directory as <code>/C/testTransfer/</code>. The code just for testing purpose.)</p>
  
  <p>I have a SFTP program using WinSCP .Net assembly. Program language is C++/CLI. It opens up a work file. The file contains many lines of FTP instructions.</p>
  
  <p>One type of instruction I have to handle is to transfer <code>*.txt</code> from source directory. The source directory may contain sub directories which may contain <code>.txt</code> as well. Once transfer is successful, delete the source files. </p>
  
  <p>I use <code>Session::GetFiles()</code> for the transfer. It correctly transfer all <code>.txt</code> files (<code>/C/testTransfer/*.txt</code>), even those in sub directories (<code>/C/testTransfer/sub/*.txt</code>), in the source to the destination.</p>
  
  <pre class="lang-c prettyprint-override"><code>transferOptions-&gt;FileMask = "*.txt";
  session-&gt;GetFiles("/C/testTransfer", "C:\\temp\\win", false, transferOption);
  </code></pre>
  
  <p>Now to remove, I use <code>session-&gt;RemoveFiles("/C/testTransfer/*.txt")</code>. I only see <code>*.txt</code> in the source (<code>/C/testTransfer/*.txt</code>), but not in the sub directory (<code>/C/testTransfer/sub/*.txt</code>), are removed. </p>