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

Function Sys_GetHostPath

engine/script/src/script_sys.cpp:328–335  ·  view source on GitHub ↗

create a path to the host device for unit testing * Create a path to the host device for unit testing * Useful for saving logs etc during development * * @note Only enabled in debug builds. In release builds returns the string unchanged * @name sys.get_host_path * @param filename [type:string] file to read from * @return host_path [type:string] the path prefixed

Source from the content-addressed store, hash-verified

326 * ```
327 */
328 static int Sys_GetHostPath(lua_State* L)
329 {
330 const char* path = luaL_checkstring(L, 1);
331 char host_path[DMPATH_MAX_PATH];
332 dmSys::GetHostFileName(host_path, sizeof(host_path), path);
333 lua_pushstring(L, host_path);
334 return 1;
335 }
336
337 /*# gets the save-file path
338 * The save-file path is operating system specific and is typically located under the user's home directory.

Callers

nothing calls this directly

Calls 2

GetHostFileNameFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected