Read files sent with spark-submit by the driver : <p>I am sending a Spark job to run on a remote cluster by running</p>

<pre><code>spark-submit ... --deploy-mode cluster --files some.properties ...
</code></pre>

<p>I want to read the content of the <code>some.properties</code> file by the <strong>driver</strong> code, i.e. before creating the Spark context and launching RDD tasks. The file is copied to the remote driver, but not to the driver's working directory.</p>

<p>The ways around this problem that I know of are:</p>

<ol>
<li>Upload the file to HDFS</li>
<li>Store the file in the app jar</li>
</ol>

<p>Both are inconvenient since this file is frequently changed on the submitting dev machine.</p>

<p>Is there a way to read the file that was uploaded using the <code>--files</code> flag during the driver code main method? </p>
