Apparently we're not using love.filesystem.write anymore? Oh well. now file:write can write data as well.

This commit is contained in:
bill@Ixion
2009-09-04 01:36:26 -05:00
parent 3655c9caae
commit 8d17ca0546
+12 -1
View File
@@ -20,6 +20,7 @@
#include "wrap_File.h"
#include <common/Data.h>
#include <common/Exception.h>
namespace love
@@ -102,9 +103,19 @@ namespace physfs
}
}
else if( luax_istype(L, 2, DATA_T)) {
try
{
love::Data * data = luax_totype<love::Data>(L, 2, "Data", DATA_T);
result = file->write(data, luaL_optint(L, 3, data->getSize()));
} catch(Exception e)
{
return luaL_error(L, e.what());
}
}
else
{
return luaL_error(L, "String expected.");
return luaL_error(L, "String or data expected.");
}
lua_pushboolean(L, result);
return 1;