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