title: Attempt to index local 'file' (a nil value) at file:write
body: <p>i'm very new to lua scripting, i'm starting with create and write text to file by Lua with this script:</p>
  
  <pre><code>A = "Hello"
  local file = io.open ('test.txt',"w")
  file:write(A)
  file:close()
  </code></pre>
  
  <p>And I got this error:</p>
  
  <blockquote>
    <p>:3 Attempt to index local 'file' (a nil value)</p>
  </blockquote>
  
  <p>What's wrong here?</p>
  
  <p>P/s: I'm running this lua on camera with CHDK.</p>