MCPcopy Create free account
hub / github.com/defold/defold / Sys_Exists

Function Sys_Exists

engine/script/src/script_sys.cpp:296–302  ·  view source on GitHub ↗

check if a path exists * Check if a path exists * Good for checking if a file exists before loading a large file * * @name sys.exists * @param path [type:string] path to check * @return result [type:boolean] `true` if the path exists, `false` otherwise * @examples * * Load data but return nil if path didn't exist * * ```lua * if not sys.e

Source from the content-addressed store, hash-verified

294 * ```
295 */
296 static int Sys_Exists(lua_State* L)
297 {
298 const char* path = luaL_checkstring(L, 1);
299 bool result = dmSys::Exists(path);
300 lua_pushboolean(L, result);
301 return 1;
302 }
303
304 /*# create a path to the host device for unit testing
305 * Create a path to the host device for unit testing

Callers

nothing calls this directly

Calls 2

lua_pushbooleanFunction · 0.85
ExistsFunction · 0.50

Tested by

no test coverage detected