MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FS_FOpenFileAppend

Function FS_FOpenFileAppend

code/qcommon/files.cpp:1045–1077  ·  view source on GitHub ↗

=========== FS_FOpenFileAppend =========== */

Source from the content-addressed store, hash-verified

1043===========
1044*/
1045fileHandle_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===========

Callers 1

FS_FOpenFileByModeFunction · 0.70

Calls 8

Q_strncpyzFunction · 0.85
FS_AssertInitialisedFunction · 0.70
FS_HandleForFileFunction · 0.70
FS_BuildOSPathFunction · 0.70
Com_PrintfFunction · 0.70
FS_CreatePathFunction · 0.70
S_ClearSoundBufferFunction · 0.50

Tested by

no test coverage detected