Writing a file to users HOME directory in C
<p>I am trying to write a .txt file to the user's HOME directory. </p>

<p>I have tried:</p>

<pre><code>char str[] = "TEST";
char* file = strcat(getenv("HOME"), "/dataNumbers.txt"); //I am concatenating the user's home directory and the filename to be created.
myFile = fopen(file,"w");
fwrite(str , 1 , sizeof(str) , myFile );
</code></pre>

<p>However, this does not create the file.</p>