title: Not able to write Message into file using Kotlin
body: <p>I am using kotlin language in my project. I used below code and code throws me no error but I am getting file not found exception in the log message.</p>
  
  <pre><code>var a="Hello"
  
  WriteToFile(a)
  
      fun WriteToFile(message: String)
      {
          try {
              var writer=FileWriter("message.txt")
              writer.write(message)
              writer.close()
          }
          catch (ex: Exception)
          {
              println("Exception $ex")
          }
      }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code> Caused by: java.io.FileNotFoundException: message.txt (No such file or directory)
  </code></pre>