=========== FS_FOpenFileAppend =========== */
| 1043 | =========== |
| 1044 | */ |
| 1045 | fileHandle_t FS_FOpenFileAppend( const char *filename ) { |
| 1046 | char *ospath; |
| 1047 | fileHandle_t f; |
| 1048 | |
| 1049 | FS_AssertInitialised(); |
| 1050 | |
| 1051 | f = FS_HandleForFile(); |
| 1052 | fsh[f].zipFile = qfalse; |
| 1053 | |
| 1054 | Q_strncpyz( fsh[f].name, filename, sizeof( fsh[f].name ) ); |
| 1055 | |
| 1056 | // don't let sound stutter |
| 1057 | S_ClearSoundBuffer(); |
| 1058 | |
| 1059 | ospath = FS_BuildOSPath( fs_homepath->string, fs_gamedir, filename ); |
| 1060 | |
| 1061 | if ( fs_debug->integer ) { |
| 1062 | Com_Printf( "FS_FOpenFileAppend: %s\n", ospath ); |
| 1063 | } |
| 1064 | |
| 1065 | FS_CheckFilenameIsMutable( ospath, __func__ ); |
| 1066 | |
| 1067 | if( FS_CreatePath( ospath ) ) { |
| 1068 | return 0; |
| 1069 | } |
| 1070 | |
| 1071 | fsh[f].handleFiles.file.o = fopen( ospath, "ab" ); |
| 1072 | fsh[f].handleSync = qfalse; |
| 1073 | if (!fsh[f].handleFiles.file.o) { |
| 1074 | f = 0; |
| 1075 | } |
| 1076 | return f; |
| 1077 | } |
| 1078 | |
| 1079 | /* |
| 1080 | =========== |
no test coverage detected