RL_GetFileLength.

This commit is contained in:
jussi
2022-12-10 18:47:45 +02:00
parent e1a85f898e
commit 7e61bffe5f
9 changed files with 34 additions and 5 deletions

View File

@@ -2069,6 +2069,24 @@ int lcoreIsFileExtension( lua_State *L ) {
return 1;
}
/*
> 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 )