Returns the filename (excluding directory and extension) of the current executable */
| 74 | |
| 75 | /** Returns the filename (excluding directory and extension) of the current executable */ |
| 76 | std::string Path_GetExecutableName() |
| 77 | { |
| 78 | std::string sExeFilename = Path_StripExtension( Path_StripDirectory( Path_GetExecutablePath() ) ); |
| 79 | #if defined( ANDROID ) |
| 80 | // We determine the App ID by looking at `/proc/self/cmdline`, as Zygote changes our process name to match. |
| 81 | FILE *pCmdlineFile = fopen( "/proc/self/cmdline", "r" ); |
| 82 | if ( pCmdlineFile != NULL ) |
| 83 | { |
| 84 | // Google Play says the maximum allowable length is 150 characters |
| 85 | char rgchAndroidAppID[ 151 ] = { 0 }; |
| 86 | fgets( rgchAndroidAppID, sizeof( rgchAndroidAppID ), pCmdlineFile ); |
| 87 | fclose( pCmdlineFile ); |
| 88 | if ( rgchAndroidAppID[ 0 ] != '\0' ) |
| 89 | { |
| 90 | sExeFilename = rgchAndroidAppID; |
| 91 | } |
| 92 | } |
| 93 | #endif |
| 94 | return sExeFilename; |
| 95 | } |
| 96 | |
| 97 | /** Returns the path of the current working directory */ |
| 98 | std::string Path_GetWorkingDirectory() |
nothing calls this directly
no test coverage detected