| 108 | //============================================================================// |
| 109 | |
| 110 | int LuaVFS::FileSize(lua_State* L) { |
| 111 | const char* path = luaL_checkstring(L, 1); |
| 112 | std::string modes = luaL_optstring(L, 2, GetReadFilter(path, L)); |
| 113 | modes = BzVFS::allowModes(modes, L2ES(L)->vfsModes->readAllowed); |
| 114 | |
| 115 | const int size = bzVFS.fileSize(path, modes); |
| 116 | if (size >= 0) { |
| 117 | lua_pushinteger(L, size); |
| 118 | } |
| 119 | else { |
| 120 | lua_pushnil(L); |
| 121 | } |
| 122 | return 1; |
| 123 | } |
| 124 | |
| 125 | |
| 126 | //============================================================================// |
nothing calls this directly
no test coverage detected