Add CLDC-1.0 based implementation of io libraries.
This commit is contained in:
@@ -11,6 +11,7 @@ checkallpass('io.close',{{f}})
|
||||
checkallerrors('io.close',{notanil},'bad argument #1')
|
||||
|
||||
-- io.input ([file])
|
||||
f = io.open("abc.txt","r")
|
||||
checkallpass('io.input',{{nil,f,"abc.txt"}})
|
||||
checkallerrors('io.input',{nonstring},'bad argument #1')
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ for i,v in ipairs(t) do
|
||||
print( string.format("%q",tostring(v)), type(v))
|
||||
end
|
||||
|
||||
local h = io.open("abc.txt", "a")
|
||||
print( 'h', io.type(h) )
|
||||
local h,s = io.open("abc.txt", "a")
|
||||
print( 'h', io.type(h), s )
|
||||
print( 'write', h:write('\nmore text\neven more text\n') )
|
||||
print( 'close', h:close() )
|
||||
|
||||
@@ -61,6 +61,12 @@ for l in io.lines() do
|
||||
print( string.format('%q',l) )
|
||||
end
|
||||
|
||||
local count = 0
|
||||
io.tmpfile = function()
|
||||
count = count + 1
|
||||
return io.open("tmp"..count..".out","w")
|
||||
end
|
||||
|
||||
local a = io.tmpfile()
|
||||
local b = io.tmpfile()
|
||||
print( io.type(a) )
|
||||
|
||||
Reference in New Issue
Block a user