title: How to handle "System.IO.IOException: There is not enough space on the disk." in Windows Azure
body: <p>I have a problem in Windows Azure. I'm storing temporary files in local storage. After a certain time i get a System.IO.IOException: There is not enough space on the disk.</p>
  
  <p>So I have read some articles about it and microsoft themself recommends to catch the error and try to clear the files. So my question at this point is how is the best way to accomplish this?</p>
  
  <p>At the moment I would try this but I don't know if this is the best approach:</p>
  
  <pre><code>   public static void ClearTempFolder(string localStorageName)
      {
          System.IO.DirectoryInfo downloadedMessageInfo = new DirectoryInfo(RoleEnvironment.GetLocalResource(localStorageName).RootPath);
          foreach (FileInfo file in downloadedMessageInfo.GetFiles())
              file.Delete();
          foreach (DirectoryInfo dir in downloadedMessageInfo.GetDirectories())
              dir.Delete(true);
      }
  </code></pre>
  
  <p>Thanks for your help.</p>