From 973d902a16b35258629d2a0b228ad9c3f49b6198 Mon Sep 17 00:00:00 2001 From: jussi Date: Thu, 8 Dec 2022 18:24:41 +0200 Subject: ReiLuaGui File explorer. --- src/core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index eabfe52..dd2783a 100644 --- a/src/core.c +++ b/src/core.c @@ -2243,6 +2243,24 @@ int lcoreChangeDirectory( lua_State *L ) { return 1; } +/* +> isFile = RL_IsPathFile( string path ) + +Check if a given path is a file or a directory + +- Failure return nil +- Success return bool +*/ +int lcoreIsPathFile( lua_State *L ) { + if ( !lua_isstring( L, -1 ) ) { + TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_IsPathFile( string path )" ); + lua_pushnil( L ); + return 1; + } + lua_pushboolean( L, IsPathFile( lua_tostring( L, -1 ) ) ); + return 1; +} + /* > fileDropped = RL_IsFileDropped() -- cgit v1.2.3