=========== FS_SV_FOpenFileWrite =========== */
| 775 | =========== |
| 776 | */ |
| 777 | fileHandle_t FS_SV_FOpenFileWrite( const char *filename ) { |
| 778 | char *ospath; |
| 779 | fileHandle_t f; |
| 780 | |
| 781 | FS_AssertInitialised(); |
| 782 | |
| 783 | ospath = FS_BuildOSPath( fs_homepath->string, filename, "" ); |
| 784 | ospath[strlen(ospath)-1] = '\0'; |
| 785 | |
| 786 | f = FS_HandleForFile(); |
| 787 | fsh[f].zipFile = qfalse; |
| 788 | |
| 789 | if ( fs_debug->integer ) { |
| 790 | Com_Printf( "FS_SV_FOpenFileWrite: %s\n", ospath ); |
| 791 | } |
| 792 | |
| 793 | FS_CheckFilenameIsMutable( ospath, __func__ ); |
| 794 | |
| 795 | if( FS_CreatePath( ospath ) ) { |
| 796 | return 0; |
| 797 | } |
| 798 | |
| 799 | Com_DPrintf( "writing to: %s\n", ospath ); |
| 800 | fsh[f].handleFiles.file.o = fopen( ospath, "wb" ); |
| 801 | |
| 802 | Q_strncpyz( fsh[f].name, filename, sizeof( fsh[f].name ) ); |
| 803 | |
| 804 | fsh[f].handleSync = qfalse; |
| 805 | if (!fsh[f].handleFiles.file.o) { |
| 806 | f = 0; |
| 807 | } |
| 808 | return f; |
| 809 | } |
| 810 | |
| 811 | /* |
| 812 | =========== |
nothing calls this directly
no test coverage detected