title: How can I get the file-name list of a directory from hdfs in pyspark?
body: <p>I have a directory in hdfs wich contains many files. I know the path of the directory and I am trying to get a list of those filenames the directory contains. How could I do it?</p>
  
  <p>If I have a directory as follows:</p>
  
  <pre><code>+dir/
      +f1
      +f2
      +fN
  </code></pre>
  
  <p>I want to get a list as follows:</p>
  
  <pre><code>[f1, f2, fN]
  </code></pre>