summaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index dd2783a..a4bff1a 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2070,6 +2070,24 @@ int lcoreIsFileExtension( lua_State *L ) {
}
/*
+> length = RL_GetFileLength( string fileName )
+
+Get file length in bytes ( NOTE: GetFileSize() conflicts with windows.h )
+
+- Failure return false
+- Success return int
+*/
+int lcoreGetFileLength( lua_State *L ) {
+ if ( !lua_isstring( L, -1 ) ) {
+ TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_GetFileLength( string fileName )" );
+ lua_pushboolean( L, false );
+ return 1;
+ }
+ lua_pushinteger( L, GetFileLength( lua_tostring( L, -1 ) ) );
+ return 1;
+}
+
+/*
> extension = RL_GetFileExtension( string fileName )
Get pointer to extension for a filename string ( Includes dot: '.png' )