large file support in lfs.attributes (bug #2185)

This commit is contained in:
mascarenhas
2008-03-25 16:58:29 +00:00
parent 3aba7a98fb
commit ca8efaa8e7
2 changed files with 44 additions and 28 deletions

View File

@@ -69,7 +69,8 @@ local new_att = assert (lfs.attributes (tmpfile))
assert (new_att.access == testdate2, "could not set access time")
assert (new_att.modification == testdate1, "could not set modification time")
if lfs.symlinkattributes then
local res, err = lfs.symlinkattributes(tmpfile)
if err ~= "symlinkattributes not supported on this platform" then
-- Checking symbolic link information (does not work in Windows)
assert (os.execute ("ln -s "..tmpfile.." _a_link_for_test_"))
assert (lfs.attributes"_a_link_for_test_".mode == "file")
@@ -81,9 +82,9 @@ if lfs.setmode then
-- Checking text/binary modes (works only in Windows)
local f = io.open(tmpfile, "w")
local result, mode = lfs.setmode(f, "binary")
assert(result and mode == "text")
assert((result and mode == "text") or (not result and mode == "setmode not supported on this platform"))
result, mode = lfs.setmode(f, "text")
assert(result and mode == "binary")
assert((result and mode == "binary") or (not result and mode == "setmode not supported on this platform"))
f:close()
end