RL_GetFileLength.
This commit is contained in:
18
src/core.c
18
src/core.c
@@ -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 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user