Author: fperrad
Date: Tue Dec 30 07:10:29 2008
New Revision: 34650

Modified:
   trunk/languages/lua/src/lib/luaio.pir

Log:
[Lua] io
- refactor io.tmpfile() with a StringHandle PMC

Modified: trunk/languages/lua/src/lib/luaio.pir
==============================================================================
--- trunk/languages/lua/src/lib/luaio.pir       (original)
+++ trunk/languages/lua/src/lib/luaio.pir       Tue Dec 30 07:10:29 2008
@@ -606,8 +606,6 @@
 Returns a handle for a temporary file. This file is open in update mode and
 it is automatically removed when the program ends.
 
-TODO: rewrite with a StringHandle
-
 =cut
 
 .sub 'tmpfile'
@@ -616,13 +614,11 @@
     .local pmc res
     new $P0, 'Lua'
     $S0 = $P0.'tmpname'()
-    f = new 'FileHandle'
+    f = new 'StringHandle'
     push_eh _handler
     f.'open'($S0, 'w+')
     pop_eh
     res = newfile(f)
-    new $P0, 'OS'
-    $P0.'rm'($S0)
     .return (res)
   _handler:
     new res, 'LuaNil'

Reply via email to