mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-23 11:33:05 +00:00
Initial revision
This commit is contained in:
26
teste.lua
Normal file
26
teste.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/local/bin/lua -i
|
||||
|
||||
require"luafilesystem"
|
||||
|
||||
print(luafilesystem.version)
|
||||
|
||||
function p ()
|
||||
local fh = assert (io.open ("teste", 'r'))
|
||||
assert (luafilesystem.lock (fh, 'r'))
|
||||
print (fh:read"*a")
|
||||
fh:close ()
|
||||
end
|
||||
|
||||
function wr ()
|
||||
fh = assert (io.open ("teste", 'w'))
|
||||
assert (luafilesystem.lock (fh, 'w'))
|
||||
end
|
||||
|
||||
function op ()
|
||||
fh = assert (io.open ("teste", 'r'))
|
||||
assert (luafilesystem.lock (fh, 'r'))
|
||||
end
|
||||
|
||||
function fw (x)
|
||||
assert (fh:write (x))
|
||||
end
|
||||
Reference in New Issue
Block a user