title: File Writing Permission
body: <p>I am writting an app to dump content into files.</p>
  
  <p>The flow, so far is this:</p>
  
  <pre><code>1 - User enters a Path
  
  2 - App checks if the Directory Exists and if i have Writting Permissions
  
   2.a - If if exists, creates a empty file inside and closes it
   2.b - If it does not, creates the directory and the file inside it, and closes the file
  </code></pre>
  
  <p>The problem is, once i reach the point when i actually have to write content in this file i previously created i can't write a single line , it throws me a "Access to Path Denied".</p>
  
  <p>Here is the code snippet related to the issue : </p>
  
  <pre><code>        // Writting ImgPixels to file
  
          if (BDC.BDCCommons.CommonUtils.DirectoryHasWritePermissions(folderPath))
          {
              using (StreamWriter filePointer = File.AppendText(folderPath))
              {
                  filePointer.WriteLine(imgPixels);
              }
          }
          else
          {
              LogWriter.Error ("Permissão Negada", "Diretorio [ " + folderPath + "] nao tem permissao de escrita");
          }
  </code></pre>
  
  <p>What might be causing this ?!
  Thanks in advance Guys</p>
  
  <p><strong>Improving Question:</strong></p>
  
  <p>@500 - Internal Server Error : folderPath is the Path to the Folder,yes.</p>
  
  <p>I Guess i see where is my mistake. There is no file to be written, just a folder. My Bad</p>