Msg("Testing running non lua files\n")
include( "nonlua_extension.lua.txt" )
include( "../nonlua_extension.lua.txt" )
Msg("Testing Write Operations..\n")
// Simple file write - should be allowed
file.Write( "test1.txt", "Test 1 Text" )
// No txt extension - shouldn't be allowed
file.Write( "test2", "fffff" )
// Break out of data folder - shouldn't be allowed
file.Write( "../test3.txt", "fffff" )
// Break out of data folder - shouldn't be allowed
file.Write( "./../test4.txt", "fffff" )
// Break out of data folder - shouldn't be allowed
file.Write( "H:/test5.txt", "fffff" )
// Should Fail
file.Write( "maps/gm_construct.res", "fffff" )
file.Write( "scripts/weapon_name.txt", "fffff" )
file.Write( "~/test80.txt", "fffff" )
file.Write( "///////////test80.txt", "fffff" )
Msg("\n\nTesting Read Operations..\n\n")
// Should work
local t = file.Read( "test1.txt" )
Msg("Read["..tostring(t).."]\n\n")
// Should work
local t = file.Read( "../gameinfo.txt" )
Msg("Read["..tostring(t).."]\n\n")
// Should NOT work
local t = file.Read( "../../test.txt" )
Msg("Read["..tostring(t).."]\n\n")
// Should NOT work
local t = file.Read( "c:/test.txt" )
Msg("Read["..tostring(t).."]\n\n")
// Should NOT work
local t = file.Read( "~/test.txt" )
Msg("Read["..tostring(t).."]\n\n")