MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / FileSize

Method FileSize

src/lua/LuaVFS.cpp:110–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108//============================================================================//
109
110int 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//============================================================================//

Callers

nothing calls this directly

Calls 5

GetReadFilterFunction · 0.85
L2ESFunction · 0.85
lua_pushintegerFunction · 0.50
lua_pushnilFunction · 0.50
fileSizeMethod · 0.45

Tested by

no test coverage detected